📜  mdn .map - Javascript 代码示例

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

代码示例2
const numbers = [1, 5, 10, 15];
const doubles = numbers.map(function(x) {
   return x * 2;
});
// doubles is now [2, 10, 20, 30]
// numbers is still [1, 5, 10, 15]