Consider the following return statement:
return f() || g();
The call f()
obviously is not a tail call, because the function does not actually return if f()
is falsy.
What about the g()
part though, is that a tail call? Or do I have to rewrite it like this:
const temp = f();
if (temp) return temp; else return g();