As mentioned previously, tail-calls occur when a subroutine callee is called as the last procedure of the current function. There are many ways in which this can happen.
If you are using a ternary operator in the following manner, both the one() and two() functions are tail-calls:
function myFunction(){ // Both one() and two() are in tail positions return (x === 1) ? one() : two();}
The following code example is not a tail-call, because the callee is called from within the body of the function and could be used to do further computation instead of simply being returned to the caller:
function myFunction(){ // Not in a tail position one();}
Here is another example where one callee is not in a tail-call position:
function ...