Roadmap to becoming a developer in 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Muhammad Najib Bala ef618348fe
Add content for function borrowing
2 years ago
..
100-function-borrowing.md Add content for function borrowing 2 years ago
101-this-in-a-method.md Adds JavaScript roadmap (#1537) 3 years ago
102-this-in-a-function.md Adds JavaScript roadmap (#1537) 3 years ago
103-using-this-alone.md Adds JavaScript roadmap (#1537) 3 years ago
104-this-in-event-handlers.md Adds JavaScript roadmap (#1537) 3 years ago
105-this-in-arrow-functions.md Adds JavaScript roadmap (#1537) 3 years ago
106-explicit-binding.md Adds JavaScript roadmap (#1537) 3 years ago
readme.md Adding Arithmetic & Bitwise operators - JS roadmap (#1878) 2 years ago

readme.md

This Keyword

In JavaScript, the this keyword is a little different compared to other languages. It refers to an object, but it depends on how or where it is being invoked. It also has some differences between strict mode and non-strict mode.

  • In an object method, this refers to the object
  • Alone, this refers to the global object
  • In a function, this refers to the global object
  • In a function, in strict mode, this is undefined
  • In an event, this refers to the element that received the event
  • Methods like call(), apply(), and bind() can refer this to any object

The JavaScript this Keyword This Keyword