Skip to content

Instantly share code, notes, and snippets.

@moizjv
Created July 5, 2015 21:14
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 moizjv/eff695e314fda0b40daf to your computer and use it in GitHub Desktop.
Save moizjv/eff695e314fda0b40daf to your computer and use it in GitHub Desktop.
Y combinator factorial function
const fac = (recurse) => {
return function(x) {
return x === 0 ? 1 : x * recurse(x-1);
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment