Understanding the “this” Keyword in JavaScript
Published in
3 min readMay 22, 2020
What is this?
The JavaScript this
keyword refers to the object it belongs to.
It has different values depending on where it is used:
- In a object method,
this
refers to the owner object. - Alone,
this
refers to the global object. - In a function,
this
refers to the global object.