const operations = {
value: 10,
multiply: function(x) {
return this.value * x;
},
arrow: (x) => {
return this.value * x;
},
nested: function() {
const inner = () => this.value * 2;
return inner();
}
};
console.log(operations.multiply(3));
console.log(operations.arrow(3));
console.log(operations.nested()); Post #2996
3.3K
CHALLENGE
- 👍 6
- 🔥 5