In JavaScript, the this keyword refers to an object.

Which object depends on how this is being invoked (used or called).

The this keyword refers to different objects depending on how it is used:

In an object method, this refers to the object.
Alone, this refers to the global object.
In a function, this refers to the global object.
In a function, in strict mode, this is undefined.
In an event, this refers to the element that received the event.
Methods like call()apply(), and bind() can refer this to any object.
In a browser window, the global object is [object Window]:
In HTML event handlers, this refers to the HTML element that received the event:

The call() and apply() methods are predefined JavaScript methods.
They can both be used to call an object method with another object as argument.

const person1 = {
  fullName: function () {
    return this.firstName + " " + this.lastName;
  },
};
 
const person2 = {
  firstName: "John",
  lastName: "Doe",
};
 
// Return "John Doe":
person1.fullName.call(person2);

With the bind() method, an object can borrow a method from another object.
This example creates 2 objects (person and member).
The member object borrows the fullname method from the person object:

const person = {
  firstName: "John",
  lastName: "Doe",
  fullName: function () {
    return this.firstName + " " + this.lastName;
  },
};
 
const member = {
  firstName: "Hege",
  lastName: "Nilsen",
};
 
// Return "Hege Nilsen"
let fullName = person.fullName.bind(member);