const obj = {
value: 42,
getValue: function() {
return this.value;
}
};
const unboundGetValue = obj.getValue;
const boundGetValue = unboundGetValue.bind(obj);
const boundTwice = boundGetValue.bind({ value: 100 });
console.log(
boundGetValue(),
boundTwice(),
unboundGetValue.call({ value: 7 }),
obj.getValue.apply({ value: 99 })
); Post #3557
687
CHALLENGE