Created
July 7, 2017 16:59
-
-
Save clucasalcantara/2f7a8830a63851294d1edbb2e612f3e0 to your computer and use it in GitHub Desktop.
Compose example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const compose = (f, g) => x => f(g(x)); | |
const addHeart = x => `${x.toLowerCase()}, <3`; | |
const exclaim = x => x + '!'; | |
const inLove = compose(addHeart, exclaim); | |
inLove('Hey babe'); // hey babe, <3! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment