RosettaCodeData/Task/Y-combinator/JavaScript/y-combinator-2.js

15 lines
315 B
JavaScript
Raw Normal View History

2013-04-11 01:07:29 -07:00
function Y(f) {
var g = f((function(h) {
return function() {
var g = f(h(h));
return g.apply(this, arguments);
}
})(function(h) {
return function() {
var g = f(h(h));
return g.apply(this, arguments);
}
}));
return g;
}