如何使用javascript multidimentional数组 [英] How to use javascript multidimentional array
问题描述
我有这样的桌子类型:
edulevel title board
1 ssc 1
1 olevel 2
1 dakhil 3
1职业4
2 HSC 1
2 ALevel 2
2 fazil 3
2职业4
现在我想在javascript数组中插入这个表。但我无法理解如何声明和使用javascript数组我应该使用什么类型的维数数组
我是什么尝试过:
i认为我必须使用3d阵列但是如何申报?
请帮助我。
预先谢谢。
请参阅 JavaScript数组 [ ^ ]。
但是数组中的每个项都可以是JavaScript可以处理的任何东西 - 包括数组......
所以不要'声明'一个多维数组,而是创建一个... ...
var arr = [];
arr [ 0 ] = [ 1 , 2 , 3 , 4 ];
arr [ 1 ] = [ 5 , 6 , 7 , 8 ];
// 等等......
i have such type of table:
edulevel title board
1 ssc 1
1 olevel 2
1 dakhil 3
1 vocational 4
2 HSC 1
2 ALevel 2
2 fazil 3
2 vocational 4
now i want to insert this table in javascript array.But i could not understand how to declare and use javascript array what type dimentional array should i use
What I have tried:
i think i have to use 3d array but how to declare??
Please help me.
Advance thanks.
See JavaScript Arrays[^].
In JavaScript there is no syntax to create a multi-dimensional array...
But every item in an array can be anything JavaScript can handle - including an array...
So instead of 'declare' a multi-dimensional array, create one on to go...
var arr = []; arr[0] = [1,2,3,4]; arr[1] = [5,6,7,8]; // and on and on...
这篇关于如何使用javascript multidimentional数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!