can i access the value that i have defined inside a defineProperty call? I want create something like this:
Object.defineProperty(this, 'name', {
value: 'Caaaarl',
get: function() { return <the value>; },
set: function(x) { <the value> = x; }
});
Currently I have to create a second attribute for each property.
var _name = '';
Object.defineProperty(this, 'name', {
get: function() { return _name; },
set: function(x) { _name = x; }
});
Thanks for every help!