Skip to content

Instantly share code, notes, and snippets.

@wdiasvargas
Created June 21, 2017 07:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wdiasvargas/4b4eeb5f135fa97279520a460d22a609 to your computer and use it in GitHub Desktop.
Save wdiasvargas/4b4eeb5f135fa97279520a460d22a609 to your computer and use it in GitHub Desktop.
/**
* Created in 21/06/2017.
* Author: William Dias Vargas
* Github: @wdiasvargas
*/
'use strict';
import yCombFact from './y-combinator-factorial'
export default (number) => ((fn) => fn(fn, number))((f, n) => (n <= 1)? 1: n * f(f, (n - 1)))
console.info(yCombFact(5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment