I have a parent array containing child-arrays. length property on parent array displays 0 results, even when there are child arrays present.
Here's the code:
var balances = [];
balances['kanav'] = 50;
balances['yash'] = 50;
alert(balances.length);
console.log(balances);
What's the reason?
lengthproperty is defined as the highest index plus 1, or 0 if it doesn’t contain any indices. Those properties do not count as indices.var a = new Array(8).