What does the `this` keyword refer to in a regular function called in the global scope (non-strict mode)?

JavaScript Associate Easy

JavaScript Associate — Easy

What does the `this` keyword refer to in a regular function called in the global scope (non-strict mode)?

Key points

  • The `this` keyword in a regular function called in the global scope refers to the global object.
  • In non-strict mode, `this` defaults to the global object.
  • Understanding the context in which a function is called is crucial in determining the value of `this`.

Ready to go further?

Related questions