let abc = [99, 54, 123, 78, 82]; let average = abc.reduce((num, item, index) => { if(index != abc.length-1) { return num+item; } else { return (num+item)/abc.length; } }); console.log('平均数:', average)
let abc = [99, 54, 123, 78, 82]; let average = abc.reduce((num, item, index) => { if(index != abc.length-1) { return num+item; } else { return (num+item)/abc.length; } }); console.log('平均数:', average)