I was curious what happens when you try to alter an object retrieved through a class
getter
class A {
constructor () {
let props = { foo: { hello: 'world' } };
Object.defineProperty(this, 'foo', {
get: () => props.foo
});
}
}
let a = new A();
a.foo; // { hello: 'world' }
a.foo.hello = 2;
a.foo.hello === 2; // true or false?