A Guide To The Reduce Method In Javascript​
Josh Pitzalis

thx for this amazing article, and i spotted just one thing, you can not use the word function as an argument on the pipeline exemple, probably because it s a reserved word, i spent almost half an hour trying to debug hhhh and finally figured out that i had to change it.

this is the right way to use it :

let pipeline = [increment, double, decrement];
const result = pipeline.reduce((total, func) => {
 return func(total);
}, 1);

Like what you read? Give Ma'mun mokni a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.