4 ms·
Once you realize that there are no associative arrays in JavaScript these things become less of a WTF.
by Kiro 13y ago
Once you realize that there are no associative arrays in JavaScript these things become less of a WTF.
- shinuza 13y agovar a = {}; PHP != Javascript
- dkroy 13y agoCouldn'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.