-
-
Save caasi/85e1fd9157c63ec5e6657403d8c1e878 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var fact = (function (fact) { | |
return (function (f) { | |
return f(function (f) { | |
return fact(function (n) { | |
return f(f)(n) | |
}) | |
}) | |
})(function (f) { | |
return f(f) | |
}) | |
})(function (f) { | |
return function (n) { | |
return n == 0 ? 1 : n * f(n - 1) | |
} | |
}) | |
console.log(fact(5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment