es6数组求和

es6数组求和:

let priceArr=[88,58]
let priceArrNew = priceArr.reduce((n,m) => n + m);//求和
console.log(priceArrNew);//146

 原链接:https://blog.csdn.net/u011565547/article/details/106663227/

posted @ 2021-09-10 14:43  前端HL  阅读(1821)  评论(0编辑  收藏  举报