In which context does the "this" keyword not refer to the object that calls the function?

  • Global context
  • Method context
  • Function context
  • Constructor context
The "this" keyword in JavaScript does not refer to the object that calls the function in the global context. In the global context, "this" points to the global object, which is usually the "window" object in browsers. This can be a source of confusion, so it's essential to understand the various contexts in which "this" behaves differently.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *