new-array
Creates a new dense array with the given size, optionally filled with a specified value.
var array = // > [ undefined, undefined ] // > [ 0, 0, 0, 0 ] // > [] // > [0, 1]
Primarily motivated by the fact that new Array(n)
produces an array of holes that does not play well with methods like Array#map()
.
Usage
arr = newArray(n[, value])
Returns a new dense array with length n
(default 0), where each element is set to value
(or undefined).
See Also
License
MIT, see LICENSE.md for details.