I'm wondering what the priority of the ++
operator is when being called through a recursive function like so.
var count = 0;
function recur(x){
if(x == 10)
return x;
else
return recur(x++);
}
recur(count);
In the code, when return recur(x++)
is being called, is x passing to the recur
method as x, or as x+1? And what is the difference between x++
and ++x
?
Thanks.