Recursion is an age old concept used in mathematics when an object is defined by other objects of the same type. A real life example would be the mirrors in a department store dressing room. If you look in the right spot, you can see both reflections repeating themselves in each other.
Each iteration of your image grows smaller and smaller into infinity. In computer science recursion happens when a solution to a problem is resolved by computing smaller instances of the same problem. In JavaScript, recursion boils down to a function calling itself to solve a problem.
This concept can be tough to grasp, but taking the time to learn how to code recursively provides many benefits. Sorting methods can be sped up immensely using recursion. An example of this is C. A. R. Hoare’s “Quicksort” pattern, which was developed in the 1960’s. If coded correctly, methods utilizing recursion are shorter and take up less bandwidth. Another benefit is better methods for combinational searches. And many mathematical induction methods run faster and are simpler to code using recursion, for example computing factorials.
Read More:
http://www.developerdrive.com/2012/04/javascript-and-recursion/