Created
November 30, 2018 05:39
-
-
Save krfong916/9e4c6fc49f421b66e0ada8b91485fb2e to your computer and use it in GitHub Desktop.
Ways not to instantiate an object
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 sideEffects() { | |
| console.log("this will have a side effect because thats how the object prototype mechanism just works"); | |
| } | |
| function Bar () { | |
| console.log(`hey no side effects, we're all good!`); | |
| } | |
| Bar.prototype = new sideEffects(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment