@extremejs/utils - v1.0.0-beta.23
    Preparing search index...

    Function fill

    • 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[]

      1.0.0

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