Writing the following will result in the evaluation of the Function
constructor function, resulting in the presence of a property on the global object pointing to a function-object instance Foo
.
function Foo() {}
Execution contexts are created when functions are invoked, hence has an execution context other than the global one been created even without invocation of Foo
?
My thinking is as follows:
Everything is an object in JavaScript (with minor exceptions related to primitives). Objects are created by functions. Foo
is an object. A function has been invoked.