Created
July 2, 2011 14:04
-
-
Save anonymous/1060356 to your computer and use it in GitHub Desktop.
Prototype question
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 A() { | |
| this.sayFoo = function() { | |
| console.log("foo"); | |
| }; | |
| } | |
| A.prototype.sayFoo = function() { | |
| console.log("bar"); | |
| }; | |
| function init() { | |
| var a = new A(); | |
| a.sayFoo(); | |
| delete a.sayFoo; | |
| a.sayFoo(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment