JSFiddle - React, Tailwind, and code Playground
by Darby Rathbone
JavaScript
var _test = {
value:''
};
Object.defineProperty(this, "test", {
get: function () {
return _test;
},
set: function (e) {
_test.value=e;
}
});
Object.defineProperty(test, "b", {
get: function () {
console.log(this);
return _b;
},
set: function (e) {
console.log(this);
_b.value=e;
}
});
console.log(test.value);
console.log(test.b.value);
test.b = 'honey';
test = 'bunny';
console.log(test.value);
console.log(test.b.value);