3 ms·
"Here we are using tail recursion to keep inserting the records." Correct me if I'm wrong, but I don't think he means tail recursion. It's recursion, yes. But
by stanleydrew 16y ago
"Here we are using tail recursion to keep inserting the records."
Correct me if I'm wrong, but I don't think he means tail recursion. It's recursion, yes. But does tail recursion even make sense in an asynchronous setting?
- route66 16y agoHe even mentions that it would blow up the stack ... so, no TCO is applied, which does not exist in javascript (at least not in V8). But tail recursive it is, as the recursion is the last statement. What he implements in the variation is a kind of pseudo-trampoline through setTimeout ...