Question:

Demonstrate that the this keyword equals the global object for functions that are invoked with function invocation context.

Answer:

function exampleFunction() {
  if (this === window) {
    return "this equals the global object with function invocation context";
  }
}
console.log(exampleFunction());

Functions that are not properties of an object and are not constructor functions are invoked in the function invocation context.


Keywords:

© 2017 QuizBucket.org