function factorial(x) {
	// TERMINATION
	if (x < 0) 
  		return;
  	// BASE CASE
  	if (x === 0) 
  		return 1;
  	// RECURSION
  	return x * factorial(x - 1);
}
/*
   What is Recursion? 
   To put it simple, recursion is when a function calls itself. 

   Three key features of recursion:
   1. A termination condition, where the function terminates if there is an error
   2. A base case, another termination condition once we reached our goal
   3. Recursion, when our function calls itself

   returns the factorial of a supplied integer:
   Whats a factorial? 
   To get the factorial of a number you multiply that number by itself minus one until you reach the number one.
   ex. factorial of 4 is 4*3*2*1 = 24
*/


Three key features of recursion:
1. A termination condition, where the function terminates if there is an error
2. A base case, another termination condition once we reached our goal
3. Recursion, when our function calls itself

returns the factorial of a supplied integer:
Whats a factorial.
To get the factorial of a number you multiply that number by itself minus one until you reach the number one.
ex.
Three key features of recursion : 1 . A termination condition where the function terminates if there is an error 2 . A base case another termination condition once we reached our goal 3 . Recursion when our function calls itself returns the factorial of a supplied integer : Whats a factorial . To get the factorial of a number you multiply that number by itself minus one until you reach the number one . ex .
function factorial(x) {
	if (x < 0) 
  		return;
  	if (x === 0) 
  		return 1;
  	return x * factorial(x - 1);
}
function factorial ( x ) { if ( x < 0 ) return ; if ( x === 0 ) return 1 ; return x * factorial ( x - 1 ) ; }
What is Recursion?
What is Recursion?
// TERMINATION // BASE CASE // RECURSION