Let’s break down the fizz buzz example mention previously.
This function takes an argument called number to then return an anonimous function that takes his own argument called divider returning our final logic.
Now we can do:
I know the double bracket is a bit odd ( ()() ), is our way to access both parameters ( number and divider ).
A more readable and extendable way can be:
We can finish it by doing:
A finder example
Let's do a finder function, that will make us find whatever object inside an array depending on the key and value we pass.
Our main function will look like this:
The final result is: