Skip to content

Instantly share code, notes, and snippets.

@ashumeow
Created November 6, 2013 19:14
Show Gist options
  • Select an option

  • Save ashumeow/7342330 to your computer and use it in GitHub Desktop.

Select an option

Save ashumeow/7342330 to your computer and use it in GitHub Desktop.
function Foo(){}
Foo.prototype.bar = 42;
var foo = new Foo();
delete foo.bar; // returns true, but with no effect, since bar is an inherited property
console.log(foo.bar); // alerts 42, property still inherited
delete Foo.prototype.bar; // deletes property on prototype
console.log(foo.bar);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment