4 ms·
Couldn't some JavaScript Objects be called associative arrays?
by dkroy 13y ago
Couldn't some JavaScript Objects be called associative arrays?
- Skinney 13y agoNot really no. Every object has it's prototype set to the object prototype. Which means that even if you create a new empty object, it inherits functions and values from the object protype. var a = {}; typeof(a.hasOwnProperty) === "function" Objects are very often used as associative arrays, quite simply becouse objects and arrays are all js has to offer. Javascript Harmony will change that though, with it's own Map type.