bind(), call(), and apply()
What makes method chaining possible in this code?
const calculator = {
value: 0,
add(a) {
this.value += a;
return this;
},
multiply(b) {
this.value *= b;
return this;
}
};
const calculate = calculator.add.bind(calculator, 5);
console.log(calculate().multiply(2).value);