This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.
Smartphone icons created by Freepik - Flaticon
In this example this refers to person2, even if it is a method of person1:
const person1 = { fullName: function() { return this.firstName + " " + this.lastName; } } const person2 = { firstName:"John", lastName: "Doe", } let x = person1.fullName.call(person2); document.getElementById("demo").innerHTML = x;