Can the property getter value of an object be modified? For instance:
const autoIncrementer = (function() {
let value = 0;
return {
incr() {
value++
},
get value() {
return value
}
};
})();
function anotherFunction (){//log smth.}
autoIncrementer.value = anotherFunction;
Note: I am aware that this may not serve any purpose, but I am seeking an explanation as to why this is not possible and if there is a way to make it work?