Skip to content

Instantly share code, notes, and snippets.

@colbydauph
Created December 7, 2017 19:42
Show Gist options
  • Save colbydauph/8392aaefdb2a820fddad69f37ae52444 to your computer and use it in GitHub Desktop.
Save colbydauph/8392aaefdb2a820fddad69f37ae52444 to your computer and use it in GitHub Desktop.
Y Combinator
// const factorial = Y(f => n => n > 1 ? n * f(n - 1) : 1);
const Y = f => (x => x(x))(y => f(x => y(y)(x)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment