Function composition in Javascript

preview_player
Показать описание
Function composition is cool. Little bit tricky, but, whatever, right? Anyways, we start out with an easy example and then move onto something a bit more challenging. Don't hate comment me, bro! #javascript #coding #algorithms
Рекомендации по теме
Комментарии
Автор

Good job. Good example. For unknow number of functions you can make a helper function like this:
function main(...fns)
{return fns.reduce(compose)}

amerrashed
Автор

I get lost in the part of the "for of loop" where on the right side he uses an or operator ||, How this is evaluated? Thanks in advance. If anyone could suggest what I need to focus on, in order to learn about it, I will really appreciate it.

armandoWebDev
Автор

nice, its a little hard to understand whats going on when you first starting doing stuff like this

Cognitoman
Автор

Most of tutorial show composition along with bad practices in js. Your code is not beautiful but does show composition in good way. Good job.

czlowiek