Last active
April 5, 2018 10:49
-
-
Save rohanBagchi/034cedfec1445b3a53a40b0de4a6914d 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 Foo() { | |
this.name = 'Hello'; | |
} | |
function Bar() { | |
Foo.call(this); | |
this.age = 31; | |
} | |
Bar.prototype = Object.create(Foo.prototype); | |
Bar.prototype.constructor = Bar; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment