The mutable array-like object to fill.
The static value to use to fill the array.
The index of the first element in the range to be
filled, inclusive. The default value is 0
. Negative values
are taken as an offset from the end of the array.
The index of the last element in the range to be
filled, inclusive. The default value is -1
. Negative values
are taken as an offset from the end of the array.
If stop < start
the fill will wrap at the end of the array.
Linear.
A start
or stop
which is non-integral.
import { ArrayExt } from '@lumino/algorithm';
let data = ['one', 'two', 'three', 'four'];
ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']
ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']
ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']
ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']
Generated using TypeDoc
Fill an array with a static value.