• Fills elements of array with value from start up to, but not including, end.

    Type Parameters

    • Value

    Parameters

    • array: Value[]

      The array to fill.

    • value: Value

      The value to fill array with.

    • start: number = 0

      The start position.

    • end: number = array.length

      The end position.

    Returns Value[]

    Since

    1.0.0

    Example

    fill([1, 2, 3], 0); // => [0, 0, 0]
    

    Example

    fill([1, 2, 3], 0, 1); // => [1, 0, 0]
    

    Example

    fill([1, 2, 3], 0, 1, 2); // => [1, 0, 3]