Recursion is an important programming technique, in which a function calls itself to solve some problem. A method that uses this technique is recursive. Many programming problems can be solved only by recursion, and some problems that can be solved by other techniques are better solved by recursion.
To prevent infinite recursion, you need an if-else statement where one branch makes a recursive call, and the other branch does not. The branch without a recursive call is usually the base case which do not make recursive calls to the function and prevents an infinite loop from occuring.
You may remember from math class that the factorial of a number n is the product of all positive integers less than or equal to n. In other words, the factorial of 5 is 5 x 4 x 3 x 2 x 1. The mathematical notation for this is 5!.
Next: Using jQuery Event Triggers in your coding.