How to understand trampoline in JavaScript?
The trampoline is just a technique to optimize recursion and prevent stack-overflow exceptions in languages that don’t support tail call optimization like Javascript ES5 implementation and C#. However, ES6 will probably have support for tail call optimization. The problem with regular recursion is that every recursive call adds a stack frame to the call stack, … Read more