Object.defineProperty Example
test = 1; | |
obj = { test: null }; | |
Object.defineProperty(obj, 'test', { | |
get: function() { return test; }, | |
set: function(value) { test = value } | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment