Function range

  • Create an array of integers in the specified range

    Returns

    the range as an array of numbers

    Example

    range(1, 3) === [1, 2, 3]
    

    Example

    range(3, 8) === [3, 4, 5, 6, 7, 8]
    

    Example

    range(5, 1, -1) === [5, 4, 3, 2, 1]
    

    Parameters

    • start: number

      start of range (inclusive)

    • end: number

      end of range (inclusive)

    • interval: number = 1

      the jump between successive elements (defaults to 1)

    Returns number[]

Generated using TypeDoc