Consider following code:
moduleA.js:
// moduleA.js
export const moduleVarA = "I am from moduleA";
export function greetA() {
console.log("Hello from moduleA");
}
moduleB.js:
// moduleB.js
import { moduleVarA, greetA } from './moduleA.js';
console.log(moduleVarA); // "I am from moduleA"
greetA(); //"Hello from moduleA"
I want to ask what will be the order of execution contexts of above modules in call stack? I mean will after loading and executing module A its execution context be popped off from call stack OR it will remain there until execution contexts of all importing modules(like moduleB) get finished?