Created
May 30, 2020 12:26
-
-
Save kuznetsovandrey76/3c40ddd11648ed1a62f088df74e0499d to your computer and use it in GitHub Desktop.
Рекурсия
This file contains 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 fact = (x) => { | |
if (x == 1) return 1 | |
else return x * fact(x-1) | |
} | |
console.log(fact(5)) // 120 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment