May 19, 2006
8:45 am | Last updated: March 7, 2009 at: 5:31 am
Javascript Associative Arrays considered harmful
Andrew Dupont has an insightful post warning against the use of the javascript Array type for associated arrays, when a simple Object would be better. He says:
In JavaScript, one really ought to use Object for a set of key/value pairs. But because Array works as demonstrated above, JavaScript arrays (which are meant to be numeric) are often used to hold key/value pairs. This is bad practice. Object should be used instead.
Loading
1 Response | RSS comments on this post | Leave a comment»
No Pingback yet

Thanks for posting this, I found it really helpful!