Array.prototype.fill
can fill up an array with one value
fill(0)
will populate0
into each array element- fill only changes content, adds no new elements
- second parameter to
fill()
is the position where to start filling - third parameter is the position where filling stops
Links
A discussion in a github issue, about how to use this kata.
API doc on MDN.