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