JavaScript: Map squares #8
Ready — edit the code above and click Run.
console.log([...Array(12)].map((_,i)=>(i+1)**2));
Try solving on your own first, then reveal the official answer.
Array methods are core to JS interviews.