📅  最后修改于: 2022-03-11 15:03:23.098000             🧑  作者: Mango
const sum = times.reduce((a, b) => a + b, 0);
const avg = (sum / times.length) || 0;
console.log(`The sum is: ${sum}. The average is: ${avg}.`);