Created
August 2, 2017 15:41
-
-
Save ThomasCrevoisier/f7040576b83a4078f91091cad5edb361 to your computer and use it in GitHub Desktop.
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
// The proposal | |
const doubleSay = str => str + ', ' + str; | |
const capitalize = str => str[0].toUpperCase() + str.substring(1); | |
const exclaim = str => str + '!'; | |
let result = "hello" | |
|> doubleSay | |
|> capitalize | |
|> exclaim | |
// What if instead | |
let transform = doubleSay |> capitalize |> exclaim | |
let result = transform("hello"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment