What will be the output of the following code?
const obj1 = {
name: 'John',
greet: function() {
console.log(`Hello, ${this.name}!`);
}
};
const obj2 = {
name: 'Jane'
};
obj1.greet.call(obj2);
What will be the output of the following code?
const obj1 = {
name: 'John',
greet: function() {
console.log(`Hello, ${this.name}!`);
}
};
const obj2 = {
name: 'Jane'
};
obj1.greet.call(obj2);