'Can I use getters/settings with this in javascript? Does using this.property still trigger the getter?

class MyClass {
    constructor () {
         this._value = 1
    }

    increase (e) {
        this.value = this.value + 1;
    }

    get value () {return this._value;}

    set value(value) {
         this._value = value;
    }
}

does this not work? I want increase() to trigger both the getter and setter (since its getting and setting the value)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source