While executing a js file, firstly a global execution context is created to execute the entire js code. Again, a main function is also get called to execute the same code.
So my question is, do the main function is called first and then the global execution context gets created or first the global execution context gets created first and then the main function gets created?
I think, first the Global Execution context gets created and then the main function gets created.