bind(), call(), and apply()
What's the difference in how arguments are passed in the two console.log statements?
function Person(name) {
this.name = name;
}
Person.prototype.greet = function(greeting) {
return `${greeting}, ${this.name}!`;
};
const person = new Person('John');
const greet = person.greet;
console.log(greet.call(person, 'Hello'));
console.log(greet.apply(person, ['Hi']));