Array.prototype.fill

Array.prototype.fill

Array.prototype.fill is a method on arrays that can be used to fill or change all the values in an array to a given value.

It can accept three arguments, two of which are optional.

The first argument is the value that is going to "fill" the array.

The second is an integer that corresponds to the index for where in the array to start the fill from.

And the third is another integer that corresponds to the index for where to end the fill.

Related topics

© 2024 MWXYZ