Question · JavaScript and TypeScript course · Module 12: Functional Programming
Base Case in Recursion
Why is the base case necessary in a recursive function?
Answer options
- It speeds up function execution
- Without it, recursion would be infinite and cause a stack overflow
- It prevents mutation of variables
- It is required by the ECMAScript specification
You can check the correct answer by solving this task in the CodeWorlds game.