Skip to content

Instantly share code, notes, and snippets.

View russiann's full-sized avatar
🎧
Focusing

Russian Rebouças russiann

🎧
Focusing
  • Digibee
  • Fortaleza, CE
View GitHub Profile
@logicmason
logicmason / yc.js
Last active June 18, 2021 01:46
Y combinator in JavaScript and factorial function example (recursion with all anonymous functions)
var Y = function(proc) {
return (function(x) {
return proc(function(y) { return (x(x))(y);});
})(function(x) {
return proc(function(y) { return (x(x))(y);});
});
};
var factgen = function(fact) {
return function(n) {