What is tail call optimization and which JavaScript syntax enables it in strict mode?

JavaScript Developer Hard

JavaScript Developer — Hard

What is tail call optimization and which JavaScript syntax enables it in strict mode?

Key points

  • Tail call optimization reuses the current stack frame for recursive calls.
  • It prevents stack overflow by not adding new frames for each recursive call.
  • Enabled in ES6 strict mode for functions with specific return statement structure.

Ready to go further?

Related questions