// n is your max range
[...Array(n).keys()]
let n = 10
[...Array(n).keys()] // [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
var list = [];
for (var i = lowEnd; i <= highEnd; i++) {
list.push(i);
}
function range(start, end) {
if(start === end) return [start];
return [start, ...range(start + 1, end)];
}
[...Array(5).keys()] // [0, 1, 2, 3, 4]
if (x >= 0.001 && x <= 0.009) {
// something
}
function between(x, min, max) {
return x >= min && x <= max;
}
// ...
if (between(x, 0.001, 0.009)) {
// something
}