Skip to content

Instantly share code, notes, and snippets.

@e-mihaylin
Created September 3, 2018 13:02
Show Gist options
  • Save e-mihaylin/615f6252e1aacfab7a47439a8e1a4551 to your computer and use it in GitHub Desktop.
Save e-mihaylin/615f6252e1aacfab7a47439a8e1a4551 to your computer and use it in GitHub Desktop.
const chained = f => x => f.reduce((r, f) => f(r), x);
// chained([a,b,c,d])(input)
// yields the same result as:
// d(c(b(a(input))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment