2 ms·
For the record, many implementors are against STC and PTC for a few reasons: - It may be significantly slower than regular recursive calls (though this claim s
by bcherny 9y ago
For the record, many implementors are against STC and PTC for a few reasons:
- It may be significantly slower than regular recursive calls (though this claim seems to be false both in practice and theory)
- It may break debug tools
- It may break browser telemetry (especially on IE)
Additionally, they would have to decide on an explicit syntax for STC (return.tail or something like that).
Personally, I would love to see STC anf PTC land so I can write proper functional code in JS. It would also make functional programming in JS easier to teach (less gotchas).
See TC39 discussion: https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-05/may-24.md#syntactic-tail-calls-bt https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-...