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)
})
let squares = [1,2,3,4].map(function (val) {
return val * val;
});
// squares will be equal to [1, 4, 9, 16]