In node.js.
Is Array.forEach may let other contexts to be executed before executing all elements?
How actually it works ?
I know that (correct me if something wrong please):
- The top execution context in the call stack is the context that will be executed first.
- No two execution contexts are executed at the same time.
Is that mean: - If we use loop such as (for .. in ..) there is no other execution context will be executed until the entire loop is executed and if we use forEach (which I think is creating an execution context for each element) may let other contexts that may be added by the browser for Ajax or by node.js for finished I/O operation to the call stack to be executed before the executing the callbacks for each element ?