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