Created
May 9, 2016 19:58
-
-
Save shtakai/2ec6adcc64c8b20573621e911cd4b1ff 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
var fact = function (n) { | |
return (n == 1) ? 1 : n * fact(n-1); | |
} | |
console.log( fact(7)); | |
console.log( fact(10) == 10*9*8*7*6*5*4*3*2*1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment