JS
challenger
Home
Intermediate JavaScript
array methods
Refactor a For Loop Using map()
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.
Premium
reset
function greet(name) { return `Hello, ${name}!`; } console.log(greet("Erik"));
JavaScript
Run Code
Console