Arrays & Array Methods (map, filter, reduce)
What statistical calculation is this reduce operation performing?
const numbers = [1, 2, 3, 4, 5];
const result = numbers.reduce((acc, curr, idx, arr) => {
if (idx === arr.length - 1) return (acc + curr) / arr.length;
return acc + curr;
}, 0);