News for hackers. Stuff that matters.
Re:JavaScript Tips by ntownsend on Thursday May 06, 2010 @11:17AM (#1324584)
In JavaScript, Arrays are not actually arrays. They're not a contiguous block of memory. They're just Objects (i.e. hash tables) that key on integers.

If you look at the indices it will look like you have a bunch of undefined elements in the array, but no memory has actually been consumed for those indices in the array so nothing is wasted.

Re:JavaScript Tips by DougWebb on Friday May 14, 2010 @04:56PM (#1348576)
Excellent point. I forget that javascript doesn't really have arrays, just array syntax. My example is much more appropriate in other languages with true arrays and the ability to store object references in them.