SyntaxFix
Write A Post
Hire A Developer
Questions
Calculating average (mean) using reduce and ES6:
const average = list => list.reduce((prev, curr) => prev + curr) / list.length; const list = [0, 10, 20, 30] average(list) // 15