Back
Close

Recursion in javascript (non-informative content)

Ins1deTheFire
14.4K views

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

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants