Skip to content

Instantly share code, notes, and snippets.

@Joncom

Joncom/gist:6302577

Created Aug 22, 2013
Embed
What would you like to do?
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