Is it possible to change the value of the property getter of an object? let's say we have
const autoIncrementer = (function() {
let value = 0;
return {
incr() {
value++
},
get value() {
return value
}
};
})();
function anotherFunctin (){//log smth.}
autoIncrementer.value = anotherFunction;
P.S. I know that this does not do any good, so I just need an explanation of why is this so? and is there any way to achieve this goal?