this Keyword

The 'this' keyword is a variable that is automatically set for you when a function is invoked.
Exactly what this value is depends on how the function is invoked.

This Owner is the Window

var a = function() { 
a(); // Object Window

This Owner is the Object

var obj = { 
   property1 : "text",
   method1 : function() {
obj.method1(); // text

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext