175
rated 0 times
[
176]
[
1]
/ answers: 1 / hits: 103139
/ 13 Years ago, fri, march 2, 2012, 12:00:00
In the example below, the array2.length
is only 10
, while in my mind, it should be 13
.
Why does the string keyed indexes not increase the length
of the array?
I can store things and still access it, and the VS debugger shows that those arrays are being stored properly. So why is the length
not increased?
var array2 = new Array();
array2[a] = new Array();
array2[b] = new Array();
array2[c] = new Array();
for (var i = 0; i < 10; ++i)
array2[i] = new Array();
var nothing = ;
for (var i = 0; i < array2.length; ++i)
nothing = ;
More From » javascript