Skip to content

Instantly share code, notes, and snippets.

@secf4ult
Last active February 9, 2021 08:34
Show Gist options
  • Save secf4ult/dd2d1322605368d38d2c257406d85f67 to your computer and use it in GitHub Desktop.
Save secf4ult/dd2d1322605368d38d2c257406d85f67 to your computer and use it in GitHub Desktop.
Y Combinator in JavaScript
// from Crockford's talk: https://www.youtube.com/watch?v=ya4UHuXNygM
function Y(le) {
return (function (f) {
return f(f)
}(function (f) {
return le(function (x) {
return f(f)(x)
})
}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment