JavaScript Professional — Hard
Key points
- TCO reuses stack frames to prevent stack overflow in deep recursion.
- ECMAScript mandates TCO in strict mode when the return value is directly from a call expression.
- TCO does not convert recursive functions to iterative loops or apply only to async functions.
Ready to go further?
Related questions
