Photo by Wesley Hilario on Unsplash

Call Again

The Recursion Technique — JavaScript

Call of Duty

Call Stack

Call Me

Udemy — JavaScript Algorithms and Data Structures Masterclass

Call to Action

CALL STACK4th in: return 1                // factorial(1) -> base case reached
3rd in: return 2 * factorial(1) // factorial(2) -> recursive call
2nd in: return 3 * factorial(2) // factorial(3) -> recursive call
1st in: return 4 * factorial(3) // factorial(4) -> initial call
1st out: return 1
2nd out: return 2 * factorial(1)
3rd out: return 3 * factorial(2)
4th out: return 4 * factorial(3)
1st out: resolves to -> 1
2nd out: return 2 * factorial(1)
3rd out: return 3 * factorial(2)
4th out: return 4 * factorial(3)
2nd out: resolves to -> 2 * 1 -> 2
3rd out: return 3 * factorial(2)
4th out: return 4 * factorial(3)
3rd out: resolves to -> 3 * 2 -> 6
4th out: return 4 * factorial(3)
4th out: resolved to -> 4 * 6 -> 24
24

Call When

Call of the Wild— Sample Problems

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store