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:
Here's how i do it
let n = 5 [...Array(n).keys()].map(x=>{console.log(x)})
output
0 1 2 3 4