This is Part 2 of the "Folds" series, where we look at how we could use the simple Fold pattern to perform a variety of array processing tasks.
...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks Neil for your interesting article.
Sounds as if you may be interested in Ian Hofmann-Hicks youtube channel (search evilsoft on youtube) and his Crocks A.D.T library github.com/evilsoft/crocks
But, of course, you may have encountered his offerings before.
Thanks! I had never heard of him but his content is exactly the kind of stuff I'm interested in. Reminds me of the Fantasy land spec I recently found
Enjoy!
I will look forward to further articles from you soon, I hope.
What's the benefit of doing this instead of just using the built in Array.prototype.reduce?
There is not benefit other than exploring it for fun!
I don't understand the pipe one, can you explain it better, or at least say examples of usage?
Ty.
The pipe takes in an array of functions and "connects" them so that the output of a function within that array is passed as an input to the function after it.
There are a few medium articles out there explaining it in more detail. I didn't want to make this post too detailed. I just wanted to show how much we could do using just that
fold
function