When running this piece of code, the JS engine pushes three(), two(), one() to the call stack, and in this order. My question is: Does the string "I'm function ONE!!!" return after one() is popped off the stack OR after two() and three() are popped off the stack?
I'm under the assumption that "I'm function ONE!!!" gets returned right after one is popped off the stack, and NOT after every function is popped off the stack.
Can someone correct me if I'm wrong?
function one() {
return "I'm function ONE!!!";
}
function two() {
return one();
}
function three() {
return two();
}
three();