Re:Fun with JavaScript Arrays
by Skinney on Wednesday June 12, 2013 @09:55AM
(#5868054)
Not 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.
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.