Understanding the “this” Keyword in JavaScript

krishankant singhal
Singhal Labs
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.

--

--

krishankant singhal
Singhal Labs

Angular,Vuejs,Android,Java,Git developer. i am nerd who want to learn new technologies, goes in depth.