Created
March 14, 2018 14:07
-
-
Save fdjones/738d7b12135a8245a530bc08d5a1b250 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
// Option 1 (wrong) | |
function superclass() {this.stuff="stuff";} | |
function subclass(superclass) {} | |
// Option 2 (wrong) | |
function superclass() {this.stuff="stuff";} | |
function subclass() {subclass.prototype = new superclass();} | |
// Option 3 (the option that I chose) - wrong | |
function superclass() {this.stuff="stuff";} | |
var subclass = new superclass(); | |
Option 4 - Correct | |
function superclass() {this.stuff="stuff";} | |
function subclass() {} | |
subclass.prototype = new superclass(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment