Skip to content

Instantly share code, notes, and snippets.

@ThomasCrevoisier
Created August 2, 2017 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasCrevoisier/f7040576b83a4078f91091cad5edb361 to your computer and use it in GitHub Desktop.
Save ThomasCrevoisier/f7040576b83a4078f91091cad5edb361 to your computer and use it in GitHub Desktop.
// 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