Web features explorer

Array fill()

Widely available
Tags: javascript Groups: JavaScript > Collections > Arrays JavaScript > Collections > Typed arrays

The fill() method of arrays and typed arrays sets all or some items of an array to a given a value. To learn more, see Array.prototype.fill(), TypedArray.prototype.fill() at MDN.

Compatibility