Created
January 30, 2012 00:44
-
-
Save specialunderwear/1701657 to your computer and use it in GitHub Desktop.
Change prototype and existing objects change as well
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
> var a = Counter; | |
> a; | |
0 | |
> a.next(); | |
1 | |
> a.before(); | |
Error: function before is not defined. | |
> Counter.prototype.before = function() { | |
> return this - 1; | |
> }; | |
> a.before() ; | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment