EasyEvent Loop & Promises💻 Output Question

Understanding Call Stack Flow with Nested Function Calls

💡

Hint

Pay attention to the order of console.log statements in relation to function calls to understand how the call stack operates

What does this output?

function a() { 
  console.log("Inside A"); 
  b(); 
  console.log("A finished"); 
} 
function b() { 
  console.log("Inside B"); 
} 
a();

Correct Output

Inside A
Inside B
A finished

Why this output?

More Event Loop & Promises Output Questions

EasySynchronous code runs before setTimeoutMediumPromise microtask before setTimeout macrotaskMediumPromise chain passes valuesHardTwo Promise chains interleave in microtask queue

Practice predicting output live →

66 output questions with instant feedback

💻 Try Output Quiz