Created
November 6, 2013 19:14
-
-
Save ashumeow/7342330 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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