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