Code to go logo
Created using Figma
Use Cases
Contribute
How to sum items of array in JavaScript
Arrays
By Jad Joubran ·
Last updated Jan 23, 2018
const calories = [50, 100, 200]; //sum calories.reduce((total, current) => total + current, 0);
350
Jan 23, 2018
1
Jad Joubran
See answer
1
Jad Joubran
Array.reduce
on MDN
Learn JavaScript step by step