Fills elements of array with value from start up to, but not including, end.
array
start
end
The array to fill.
The value to fill array with.
The start position.
The end position.
1.0.0
fill([1, 2, 3], 0); // => [0, 0, 0] Copy
fill([1, 2, 3], 0); // => [0, 0, 0]
fill([1, 2, 3], 0, 1); // => [1, 0, 0] Copy
fill([1, 2, 3], 0, 1); // => [1, 0, 0]
fill([1, 2, 3], 0, 1, 2); // => [1, 0, 3] Copy
fill([1, 2, 3], 0, 1, 2); // => [1, 0, 3]
Fills elements of
array
with value fromstart
up to, but not including,end
.