Intro to Recursion with Javascript.
Recursion: In computer science, recursion is a method of solving a problem where the solution depends on solutions to smaller instances of the same problem.
We will introduce what is recursion and show an example of solving a simple problem with a recursive function. We will solve a factorial problem with a recursion function. In recursion, we always want to define two scenario, a base case scenario and a recursive scenario. A base case is when the recursive function simply return a value of any type. A recursive scenario is when a recursive function will call itself again and will wait until the inner recursive function gets evaluated before proceeding.