Answer:
- Refers to the current execution context.
- In global →
this
iswindow
(in browsers). - Inside objects → refers to that object.
Example:
let person = {
name: "Ali",
greet: function() {
console.log("Hello " + this.name);
}
};
person.greet(); //
Leave a Reply