Created
January 21, 2025 16:04
-
-
Save ZenLiuCN/1344edc3aac077eca31f1a0918d321f4 to your computer and use it in GitHub Desktop.
functions
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
const Y=fn => (u => u(u))(x => fn((...args) => x(x)(...args))); | |
const factorial=Y(fa => n => n <= 1? 1: n * fa(n - 1)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment