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:
This is my preferred way. It allows you to specify one or two inputs like in Python.
function range(start, end) { return Array.from(Array(end||start).keys()).slice(!!end*start) }