@jossmac/lil-libs
    Preparing search index...

    Function sequence

    • Builds an inclusive numeric array from start to end.

      Accepts negative step values (the absolute step size is used). Decimal precision is derived from step.

      • start: number

        First value in the sequence (inclusive).

      • end: number

        Last value in the sequence (inclusive).

      • step: number = 1

        Absolute increment between values; sign is ignored. Defaults to 1.

      An ascending or descending array from start to end, rounded to the precision implied by step.

      sequence(1, 5); // [1, 2, 3, 4, 5]
      sequence(5, 1); // [5, 4, 3, 2, 1]
      sequence(0, 1, 0.33); // [0, 0.33, 0.66, 0.99]

      When step is 0, or fails the isFiniteNumber guard.