1const array1 = [1, 4, 9, 16];
2
3// pass a function to map
4const map1 = array1.map(x => x * 2);
5
6console.log(map1);
7// expected output: Array [2, 8, 18, 32]
1const array = [2, 5, 9];
2let squares = array.map((num) => num * num);
3
4console.log(array); // [2, 5, 9]
5console.log(squares); // [4, 25, 81]
1const numbers = [1, 2, 3, 4, 5];
2
3const bigNumbers = numbers.map(number => {
4 return number * 10;
5});