Created
October 29, 2018 18:25
-
-
Save adatg/1facb5a50a4e9980e53d3230a77fe7ea to your computer and use it in GitHub Desktop.
Calculate factorial
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
| function factorial(num) { | |
| var result= 1; | |
| for (var i = 2; i <= num; i++) { | |
| result *= i; | |
| } | |
| return result; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment