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}
1function factorialize(num) {
2 if(num < 2) return 1;
3 return num *= factorialize(num - 1);
4}
1function factorial(n) {
2 return n < 0 || Boolean(n % 1) ? undefined : n == 0 ? 1 : factorial(n - 1) * n;
3};