What is the default binding of "this" in JavaScript?

  • Global object
  • Parent object
  • Undefined
  • Null
The default binding of "this" in JavaScript is the global object. In most cases, when "this" is not explicitly set or bound to an object, it defaults to the global object (e.g., "window" in browsers). This behavior can lead to unexpected results, so it's crucial to be aware of it and handle "this" appropriately in your code.
Add your answer
Loading...

Leave a comment

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