Skip to content

Instantly share code, notes, and snippets.

@kalisjoshua
Created April 13, 2017 13:19
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 kalisjoshua/533ba85e2c262607b624d6a521b1a783 to your computer and use it in GitHub Desktop.
Save kalisjoshua/533ba85e2c262607b624d6a521b1a783 to your computer and use it in GitHub Desktop.
JavaScript function composition.
const compose = (...fns) =>
fns.reduceRight((g, f) => (...args) => f(g(...args)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment