const base = {
get value() {
return this._value ?? 'default';
},
set value(v) {
this._value = v;
}
};
const derived = Object.create(base);
derived.value = 'hello';
const another = Object.create(base);
console.log(derived.value, another.value, derived.hasOwnProperty('_value')); Post #3492
1.59K
CHALLENGE
- 🤣 7