Obsessed with React and teaching. I help people become Frontend Developers. Living with my fiancee and Yorkshire Terrier 🐶 in Poland.
Obsessed with React and teaching. I help people become Frontend Developers. Living with my fiancee and Yorkshire Terrier 🐶 in Poland.
Image by jackmac34 from pixabay

Sum using reduce

Dec 14, 2020

DESCRIPTION

Use the versatile .reduce method to sum an array of numbers.

Sum those numbers

JavaScript

Summary

  • Reduce method is very flexible and can help in all kinds of arrays transformations.
  • It can reduce numbers to sum them up or calculate the average number for example.
  • It also works great with other data structures such as arrays of strings or arrays of objects.
logo with a rocket of the BigDevSoon application

Level up your Frontend skills

Code real-world projects based on Figma designs.
spread the word
Did you like this post? Share it with the world! 🌐