It's a shame JS implementations still don't support tail call optimization. More and more JS is not written, but cross-compiled, and a lot of time the source language makes functional approach natural and easy to reason about.
Structural recursion is much easier to reason about than iteration, but you need TCO to make it fast, and most modern backends including .Net can already do it.
AFAIK ES2015 at the very least supports TCO as part of the spec, and allegedly the V8 implementation does support TCO, but I'm having a hard time finding any firm confirmation.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It's a shame JS implementations still don't support tail call optimization. More and more JS is not written, but cross-compiled, and a lot of time the source language makes functional approach natural and easy to reason about.
Structural recursion is much easier to reason about than iteration, but you need TCO to make it fast, and most modern backends including .Net can already do it.
AFAIK ES2015 at the very least supports TCO as part of the spec, and allegedly the V8 implementation does support TCO, but I'm having a hard time finding any firm confirmation.