Last active
December 28, 2015 17:48
-
-
Save mamoo/e64dc274b94742de69e7 to your computer and use it in GitHub Desktop.
Array initialization (ECMAScript 5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Initialize an array of x items with undefined values. | |
| //cfr. http://www.2ality.com/2013/11/initializing-arrays.html | |
| var x = 5; | |
| Array.apply(null, Array(x)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment