Using reduce() function in JavaScript to get the Sum of an array of numbers

preview_player
Показать описание
Using reduce() function in JavaScript to get the Sum of an array of numbers is very easy and readable.

Rather than manually looping through an array, you can use reduce function on this array. It will run this passed arrow function on each item of the array.
Рекомендации по теме