Matt Seymour

Unlike other programming languages Javascript does not have a native range function. By range function I am talking about a function which given an integer will return an Array/List with sequential values.

For example in Python you can do the following:

> range(5)
< [0, 1, 2, 3, 4]

Or, if you want the numbers 1-5:

> range(1, 6)
< [1, 2, 3, 4, 5]

The good news is you can simulate a basic range function with the following if not slightly elongated code:

> Array.from(Array(5), (_, x) => x +1 )
< [1, 2, 3, 4, 5]