Recursion in javascript (non-informative content)

Ins1deTheFire
21.6K views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

Recursion

An act of a function calling itself. Recursion is used to solve problems that contain smaller sub-problems. A recursive function can receive two inputs: a base case (ends recursion) or a recursive case (continues recursion). (MDN)

Use cases

Sum function with traditional for loop

Sum function with recursion

Deatiled example:

Deep map function without recursion

Deep map function with recursion

Translated resources

Open Source Your Knowledge: become a Contributor and help others learn. Create New Content