Last active
July 26, 2021 12:51
-
-
Save eamon0989/3a1ed539c999b9349e711509def8fea5 to your computer and use it in GitHub Desktop.
This file contains 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 Factory() { | |
this.foo = 1; | |
this.bar = 'string'; | |
} | |
Factory.prototype.example = "I'm a property of Factory.prototype"; | |
console.log(Factory.prototype); // { example: "I'm a property of Factory.prototype" } | |
let descendant = new Factory(); | |
console.log(descendant); // Factory { foo: 1, bar: 'string' } | |
console.log(descendant.example); // I'm a property of Factory.prototype |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment