Factorial Flashcards

1
Q

Write function to find factorial of number?

A
function factorialize(num) {
 if(num \< 0) {
 return;
 }
 if(num \< 2) {
 return 1;
 }
 return num \* factorialize(num - 1);
}

factorialize(5);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly