Generate an array with a range of numbers.

range(0, 5); // [0, 1, 2, 3, 4, 5]
range(0, 10, 2); // [0, 2, 4, 6, 8, 10]
  • Parameters

    • start: number

      the starting value

    • end: number

      the end value

    • steps: number = 1

      the steps to move

    Returns number[]

    number range