What will be the output of the following code?
function printName() {
console.log(this.name);
}
const person = {
name: 'John',
printName: printName
};
const anotherPerson = {
name: 'Jane'
};
person.printName.call(anotherPerson);
What will be the output of the following code?
function printName() {
console.log(this.name);
}
const person = {
name: 'John',
printName: printName
};
const anotherPerson = {
name: 'Jane'
};
person.printName.call(anotherPerson);