function FirstFactorial(num) { return num<=1?1:num*(FirstFactorial(num-1)); }He's using the ternary operator there, the shortest possible way to say if/then. IF: the num is less than or equal to 1, DO THIS: return 1, AND IF IT'S NOT: multiply the num by FirstFactorial num-1. So once he has a stack of not-quite-resolved functions and the num gets to 1, it returns 1 and then the rest of the stack has all the numbers it needs to work with and can resolve the final return.

My first pass on recursion was the below, and I got stack overflow (infinite program), which I can see now is because the num kept getting bigger but the recursion would only end when the num got to 0.

function FirstFactorial(num) { if (num > 0) { num *= (num - 1); FirstFactorial(num); } return num; } FirstFactorial(5);