How to use the map() method?
const numbers = [1, -9, 42]
const divideByTwo = numbers.map(number => number / 2)
//output: [0.5, -4.5, 21]
console.log(divideByTwo)
September 1st, 2019
map()
is calling a function on every element of the array and creates a new array.