-
-
Save creyn/79b02c5aee0547bb3fb18eaceeb69e61 to your computer and use it in GitHub Desktop.
Droga Programisty : Kod : Funkcje w JavaScript 2
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
function Silnia(n) { | |
var silnia = 1; | |
for (var i = 1; i <= n; i++) { | |
silnia = silnia * i; | |
} | |
return silnia; | |
} | |
console.log(Silnia(2) + ' = ' + 2); | |
console.log(Silnia(3) + ' = ' + 6); | |
console.log(Silnia(10) + ' = ' + 3628800); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment