数组reduce用法

const arr=[15,16,17,18,19]
            
           let num= arr.reduce((pre,next) =>
                pre+next
            )
            console.log('num',num);   //85

你可能感兴趣的:(前端,javascript,vue.js)