//an array of numbers
let numberArray = [1, 2, 3, 4, 5];
//output the square of each number
let returnValue = numberArray.forEach(num =>
console.log(`${num} x ${num} = ${num * num}`)
);
//the array hasn't changed
console.log(numberArray);
console.log(returnValue);
This Pen doesn't use any external CSS resources.