call stack
function doMath(x,y){
return square(x) - square(y);
}
function square(num){
console.log(Error().stack);
return multiply(num,num);
}
function multiply(x,y){
return x * y;
}
doMath();
doMath();
Which functions will be on the call stack when the call stack is logged inside the square() function for the first time? Functions are listed from left to right in order of call stack height
event queue and call stack
There are currently several functions on the call stack that are in the process of running.
The event queue is empty.
A mouseclick
event occurs and puts a new task onto the event queue.
What happens next?