News for hackers. Stuff that matters.
Re:Fun with JavaScript Arrays by dkroy on Wednesday June 12, 2013 @09:30AM (#5867934)
Couldn't some JavaScript Objects be called associative arrays?
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.

Re:Fun with JavaScript Arrays by spirit23 on Wednesday June 12, 2013 @10:09AM (#5868135)
Not really. Actually you can create an empty object by: var a = Object.create(null)
Re:Fun with JavaScript Arrays by Skinney on Thursday June 13, 2013 @03:50AM (#5872781)
oooo, shiny!