//an array of numbers
let numberArray = [1, 2, 3, 4, 5];
//output the square of each number
let returnValue = numberArray.map((num) => num * num)
//view the results
console.log(numberArray);
console.log(returnValue);
This Pen doesn't use any external CSS resources.