定义多维数组

来源:4-10 编程练习

小张刘

2015-03-30 17:18

我只想知道那个数组如何定义哦~这是四维的?难道是这样?也太麻烦了~ var myarr=[["小A","小B","小C","小D","小E","小F","小G","小H","小I","小J"],["女","男","男","女","女","男","女","女","女","男"],[21,23,24,21,22,21,22,20,20,20],["大一","大三","大四","大一","大四","大一","大二","大三","大一","大三",]]

写回答 关注

1回答

  • 康振宁
    2015-03-31 11:27:21
    已采纳

    这是二维的,不是四维的。

    你这样定义的话,你怎么茶到每个人所对应的信息呢 ?这样挺麻烦的,你可以这样

     var myarr=[["小A","女",21,"大一"],["小B","男",23,"大三"]]

    小张刘

    非常感谢!我明白了!

    2015-03-31 11:56:04

    共 1 条回复 >

JavaScript进阶篇

本课程从如何插入JS代码开始,带您进入网页动态交互世界

468061 学习 · 21891 问题

查看课程

相似问题