Ad
Mathematics
Algorithms
Logic
Numbers
Data Types
Code
Diff
  • const average = a => a.length ? a.reduce((avg, i) => avg + i/a.length, 0): a[0];
    • const average = a => a.length ? a.reduce((acc, cur) => {return acc + cur/a.length}, 0): a[0];
    • const average = a => a.length ? a.reduce((avg, i) => avg + i/a.length, 0): a[0];