Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
49 views

If Array.prototype.map is not in the call stack, how exactly JavaScript knows to not run any other code before its iteration is over?

function callback(x) { // also tried debugger to find .map in the call stack console.trace(); return 2*x; } [1,2,3].map(callback); console.log('Next line of code'); console What I know about ...
Nick_the_Slasher_McGurk's user avatar
3 votes
1 answer
611 views

Does the both functions parent and asynchronous child get re-pushed to call stack from task queue on completion of async code of child function?

What i all know about call stack is: If there is only one function being called it will be pushed to call stack and removed when its job is done or otherwise return statement is encountered. If one ...
Yogesh Kakde's user avatar
-1 votes
1 answer
75 views

why my async code is not executing inspite of being the free call stack

As per my knowledge async code is executed when the call stack is empty and execution of the async code is finished in web API But In a given code why my async code which is setTimeout function and ...
MohishKhadse55's user avatar
0 votes
0 answers
244 views

JavaScript: What is the data structure for the call stack?

I'm writing an article about JS concurrency model and event loop. I've read many (even internally) conflicting articles regarding the data structures of the call stack and Execution Contexts. A ...
André Casal's user avatar
  • 1,190
4 votes
3 answers
281 views

Why are function expressions not included in the variable object of the Execution Context?

While going through the Execution Context part of the JavaScript.The Core. (1st ed.) by Dmitry Soshnikov, I came across this line that explicitly says that function expressions are not included in the ...
amkhrjee's user avatar
  • 936
6 votes
2 answers
2k views

Callback function executing in the call stack even when it's not empty

When the click event is fired from the mouse, it behaves as expected: First the listener 1 is pushed into the stack where it queues promise 1 in Microtask Queue(or Job Queue). When listener 1 is ...
Onex's user avatar
  • 73
-1 votes
1 answer
74 views

Call Stack order of operations in Javascript - JS foundational concept

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 ...
Eug's user avatar
  • 185