This is not a position, but an execution order that leads to this in the first function, a statement
return computeMaxCallStackSize() + 1;
first increment and then add 1
return 1 + computeMaxCallStackSize();
If you try both return statements as the same, this will result in the same value. In the later case, when the digit is first, the js call stack exceeds the overflow sooner than before. The value of callstack depends on the order of execution, since in the second you change the order in which you get a lower value, since recursion occurs later.
You can also check by adding some console.log () or the stack stack of local variables will gradually decrease with increasing execution statements.
If you try computeMaxCallStackSize() + 1; , you will get the same value.
source share