1function factorial(n) {
2 if (n < 0) return;
3 if (n < 2) return 1;
4 return n * factorial(n - 1);
5}
1function factorialize(num) {
2 var result = num;
3 if (num === 0 || num === 1)
4 return 1;
5 while (num > 1) {
6 num--;
7 result *= num;
8 }
9 return result;
10}
1 function factorial(n) {
2 if (n > 1) {
3 return n * factorial(n - 1);
4 }
5 return 1;
6 }
1function factorialize(num) {
2 if (num < 0)
3 return -1;
4 else if (num == 0)
5 return 1;
6 else {
7 return (num * factorialize(num - 1));
8 }
9}
10factorialize(5);
1function factorialize(num) {
2 if(num < 2) return 1;
3 return num *= factorialize(num - 1);
4}