DEV Community

Discussion on: filter, map and reduce in JS. When and Where to use??

Collapse
lukeshiru profile image
LUKESHIRU

You can explain reduce with a sum and is clear enough:

const numbers = [1, 2, 3];
numbers.reduce((total, number) => total + number, 0); // 6
Enter fullscreen mode Exit fullscreen mode