this Keyword in Different Contexts
Why use an arrow function for the increment method?
class Counter {
#count = 0;
increment = () => {
this.#count++;
console.log(this.#count);
};
}
class Counter {
#count = 0;
increment = () => {
this.#count++;
console.log(this.#count);
};
}