Is there a function in JavaScript similar to Python\'s range()?
range()
I think there should be a better way than to write the following lines every time:
For a very simple range in ES6:
let range = n => Array.from(Array(n).keys())
From bigOmega's comment, this can be shortened using Spread syntax:
let range = n => [...Array(n).keys()]