Let's consider this example, that outputs the squares of the numbers 3, 5, and 7:
let nums = [3, 5, 7]
let squares = nums.map(function (n) {
return n * n
})
console.log(squares)
Run in RunKit
The function passed to .map can also be written as arrow function by removing the function keywor...