Message from JavaScript discussions

May 2017

— Makes sense to learn basic syntax of Java/C-like langs if just to understand the examples


a ? b : c && d()
is this (^) interpreted like this?
a ? b : (c && d())
or like this?
(a ? b : c) && d()

also; in which cases isn't d() in tail-call position?

— This is actually the d-function calling itself recursively, that expression is returned

— I think I might have it...

— It uses the ... operator to put arguments into d

— Doesn't JS reuse stack frames if the argument count isn't the same?

— First one , I guess, (c && d())

— Node doesn't apply the optimization

— Node v7.10.0
running with:
node --harmony_tailcalls

— Ahhh, I think I have the problem

— "Tail call optimization can only be made in strict mode"

— Nope, still doesn't work