DEV Community

loading...

Discussion on: Function Composition Explained Using Pokémon Evolution

Collapse
shimphillip profile image
Phillip Shim

Nice, this is the beauty of JavaScript. Passing in functions as arguments make the language to do some interesing stuff..

Also not relevant to composition but using switch statement is better inside eevee function since there are more than 2 different conditionals.

Collapse
adam_cyclones profile image
Adam Crockett

Higher order functions are not unique to JavaScript tho, so it's just a really nice feature.

Collapse
shimphillip profile image
Phillip Shim

Good to know :)

Collapse
cat profile image
Cat Author

True. I wanted to use the switch function, but since my friend was a complete newbie and was already inundated with all the info, I stuck with what she knew: if/else. lol