1The map() method creates a new array populated with the results of calling
2a provided function on every element in the calling array.
3
4const array1 = [1, 4, 9, 16];
5
6// pass a function to map
7const map1 = array1.map(x => x * 2);
8
9console.log(map1);
10// expected output: Array [2, 8, 18, 32]