bind(), call(), and apply()
What pattern is demonstrated in this code?
class Animal {
constructor(name) {
this.name = name;
}
makeSound(sound) {
console.log(`${this.name} says ${sound}`);
}
}
const dog = new Animal('Dog');
const cat = { name: 'Cat' };
dog.makeSound.call(cat, 'meow');