+ 5
Length of array inside array
let arr = [ [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3] ]; Here, If we write arr.length we get 4. How can we get the length of the array inside the main array (which is 3)?
1 ответ
+ 8
just simple.
arr[0].length;
let arr = [ [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3] ]; Here, If we write arr.length we get 4. How can we get the length of the array inside the main array (which is 3)?