Created
June 21, 2017 07:22
-
-
Save wdiasvargas/4b4eeb5f135fa97279520a460d22a609 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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