Last active
November 28, 2016 13:29
-
-
Save brunocarvalhodearaujo/81870679af9e12f6d3b5 to your computer and use it in GitHub Desktop.
Fatorial de um numero
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(number) { | |
var result = 1 | |
do { | |
result = result * number | |
number-- | |
} while (number > 0) | |
return result | |
} | |
console.log(factorial(7)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment