The JavaScript this Keyword

Example var person = { firstName: “John”, lastName : “Doe”, id       : 5566, fullName : function() { return this.firstName + ” ” + this.lastName; } }; Try it Yourself » What is “this”? In a function definition, this refers to the “owner” of the function. In the example above, this refers to the person object. The person object “owns” the fullName method. Default Binding When used alone, this refers to the Global object. In a browser the Global object is […]