Skip to content
On this page

toRange

Create an array of sequential numbers with end values.

Example

toRange(5) // => [0, 1, 2, 3, 4, 5]
toRange(1, 5) // => [1, 2, 3, 4, 5]
toRange(0, 10, 2) // => [0, 2, 4, 6, 8, 10]

Playground

const { toRange } = require('rhodash')
toRange(5) // => [0, 1, 2, 3, 4, 5]