In JavaScript, this refers to the object that is currently executing the code. When used inside a method of an object, this refers to the object itself. This allows methods to access and manipulate the object's properties.
person with properties firstName and lastName.getFullName to the person object that returns the full name by combining firstName and lastName.this keyword inside the getFullName method to access the object's properties.output div.
const person = {
firstName: 'John',
lastName: 'Doe',
getFullName: function() {
return this.firstName + ' ' + this.lastName;
}
};