📜  在数组中映射 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:28.905000             🧑  作者: Mango

代码示例2
const array1 = [1, 4, 9, 16];

// pass a function to map
const map1 = array1.map(x => x * 2);

console.log(map1);
// expected output: Array [2, 8, 18, 32]