After long times programming, I don't know why never have seen this:
var array = [];
array['one'] = 1;
console.log(array.length);
Here is a fiddle that shows array.length
is zero (0):
https://jsfiddle.net/0c9v5txe/1/
Of-course, I don't need the length of array, just array.map
is not working when the length
is zero.
Isn't there really a way to force Javascript update the length
of an associative array when adding a new item?