Created
July 30, 2018 23:21
-
-
Save gladchinda/121fcdfa0e9dc15b939d537f27d957dd to your computer and use it in GitHub Desktop.
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
| // The traditional function body wrapped in curly braces | |
| // is used here to aid readability. | |
| // Pair of parentheses cannot be omitted | |
| const factorial = (n = 1) => { | |
| return (n <= 1) ? 1 : n * factorial(n - 1); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment