Skip to content

Instantly share code, notes, and snippets.

@nhunzaker
Created April 12, 2014 16:32
Show Gist options
  • Save nhunzaker/10544582 to your computer and use it in GitHub Desktop.
Save nhunzaker/10544582 to your computer and use it in GitHub Desktop.
var Person = { name: "Default name" }
var Charles = Object.create(Person, {
name: {
get: function() {
return "Charles";
},
set: function() {
alert("Hey now, don't be assigning me");
}
}
});
Charles.name
Charles.name = "error"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment