for-of statement of sparse array

Brandon Benvie brandon at brandonbenvie.com
Fri Jul 6 01:20:15 PDT 2012


Or as a general purpose function:

var makeDense = Function.apply.bind(Array, null);
makeDense(Array(20));
makeDense([,,,,5,,,,])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120706/2e730237/attachment.html>


More information about the es-discuss mailing list