6 ms·
That's just how it optimizes their usage under-the-hood, but as far as JS is concerned they are all hash maps. For example, try this: var foo = [1,2,3];
by squeaky-clean 8y ago
That's just how it optimizes their usage under-the-hood, but as far as JS is concerned they are all hash maps.
For example, try this:
var foo = [1,2,3]; // or `foo = new Array(1,2,3)` also works
foo['bar'] = 'test';
console.log(foo);
and you get:
0:1
1:2
2:3
bar:"test"