Example

const obj = {
    get foo() {
        console.log('GET foo');
        return 123;
    },
    set bar(value) {
        console.log('SET bar to '+value);
    }
};
 
obj.foo
obj.bar = 'tralala'