JavaScript how to ❓ use reduce method to sum property values of an array of objects

preview_player
Показать описание
#javascirpt #javascriptarrays #javascriptarrayofobjects #reducemethod #javascriptreduce
How do we use reduce method to sum values of a specific property?
Рекомендации по теме
Комментарии
Автор

scorers.map(scorer => scorer.goals).reduce((total, goals) => total + goals)

This would be simpler and easier to understand

shadowplay
Автор

How to add a number to each value using spread operator

ishamsyed
Автор

what extension give you the result realtime please

blal
Автор

not easy to understand
the variables in the arrow function!

educationaltechnology