Created
July 13, 2013 05:13
-
-
Save kswlee/5989493 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 Waffle() { | |
| if (!(this instanceof Waffle)) { | |
| return new Waffle(); | |
| } | |
| this.tastes = "yummy"; | |
| } | |
| Waffle.prototype.wantAnother = true; | |
| // testing invocations | |
| var first = new Waffle(), | |
| second = Waffle(); | |
| console.log(first.tastes); // "yummy" | |
| console.log(second.tastes); // "yummy" | |
| console.log(first.wantAnother); // true | |
| console.log(second.wantAnother); // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment