const obj = {
count: 0,
increment() {
this.count++;
},
getCount() {
return (() => this.count)();
}
};
obj.increment();
obj.increment();
console.log(obj.getCount());
Post #1643
6K
CHALLENGE
- 👍 12
- 🔥 5
- 🤣 2