36) What is this keyword in JavaScript?

The this keyword is a reference variable that refers to the current object. For example:

var address=
{
company:”Javatpoint”,
city:”Noida”,
state:”UP”,
fullAddress:function()
{
return this.company+” “+this.city+” “+this.state;
}
};
var fetch=address.fullAddress();
document.writeln(fetch);

Leave a Reply