function range(a,b,c=1) { return Array.from({length : (b - a + c)/c|0 }, (v,k) => a + k * c) } console.log(range(1, 10, 2));