A resourceful newsletter featuring the latest and most important news, articles, books and updates in the world of #javascript π Don't miss our Quizzes!
Let's chat: @nairihar
Post #2313
4.98K
CHALLENGE
const calculator = {
value: 10,
add: function(x) {
return this.value + x;
},
multiply: function(x) {
return this.value * x;
}
};
const add5 = calculator.add;
const double = calculator.multiply.bind(calculator);
const triple = calculator.multiply.bind({value: 3});
console.log(add5(2) + double(3) + triple(4));- β€ 2
- π 2




