Skip to content

Instantly share code, notes, and snippets.

@proprietary
Last active August 22, 2017 22:42
Show Gist options
  • Save proprietary/ba728d8c430c47d0c64e01917f117f5e to your computer and use it in GitHub Desktop.
Save proprietary/ba728d8c430c47d0c64e01917f117f5e to your computer and use it in GitHub Desktop.
const Y = f => (x => x(x))(x => f(v => x(x)(v)))
// example
let factorial = Y(fact => n => n === 1 ? 1 : n*fact(n-1))
factorial(4) // => 24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment