📜  列表中的数字平均值 javascript 代码示例

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

代码示例2
const scores = [ 20, 50, 75, 100, 115 ];
let total = 0;

for ( let i = 0; i < scores.length; i++ ) {
  total += scores[i];
}

console.log( total / scores.length );