摘要: Array.map() 此方法是将数组中的每个元素调用一个提供的函数,结果作为一个新的数组返回,并没有改变原来的数组 let arr = [1, 2, 3, 4, 5] let newArr = arr.map(x => x*2) //arr= [1, 2, 3, 4, 5] 原数组保持不变 //n 阅读全文
posted @ 2022-02-06 19:51 牛赞 阅读(58) 评论(0) 推荐(0)