DEV Community

Cover image for Understanding `this` keyword in javascript

Understanding `this` keyword in javascript

Royal Jain on February 10, 2024

The this keyword in JavaScript is a reference to the object that is currently executing or invoking the current method or function. It is a context...
Collapse
 
kresli profile image
Eduard Jacko

Nice. I would also mention difference between globalThis, global and window. But otherwise pretty well done

Collapse
 
royaljain profile image
Royal Jain

Thanks. Can you elaborate on this?

Collapse
 
sakshamverma profile image
SAKSHAM VERMA • Edited

globalThis, global, and window are basically the terms used in the context of different programming environments, particularly in our Js. Each of them refers to the global object in various contexts.
The explaination by Royal Jain is up to mark and one needs to know only content provided by Jain.
Apart from only development if you really enjoy the engineering side of this keyword then it would be a great providing the juicy information.
Btw I suck at writing you can always give constructive criticism on my writing skill to improve it.
Thanks,

Collapse
 
kresli profile image
Eduard Jacko
Collapse
 
idanref profile image
Idan Refaeli

Nice refresher!

Collapse
 
meysam267 profile image
Sana

thank you