Writing the following result will evaluate the function of the Function constructor, which will result in the presence of a property in the global object that points to the instance of the Foo object.
function Foo() {}
Execution contexts are created when functions are called, so does it have a different execution context than the global one, which was created even without calling Foo ?
My thinking is as follows:
All this is an object in JavaScript (with minor exceptions related to primitives). Objects are created by functions. Foo is an object. The function is called.
source share