Refactor a For Loop Using map()

Refactor the code to use the array map() function instead of the for loop to create a new array containing the squares of each number.
JavaScript
Console