let qty = 10; let numToArray = [...Array.from(Array(qty)).keys()]; // (10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] numToArray.map(x =>{ console.log(x) })