Created
October 17, 2014 00:14
-
-
Save mrkaspa/594faa544bee3ea5851d 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
var util = require("util"); | |
var obj1 = function () { | |
this.color = "green"; | |
this.type = "suv"; | |
}; | |
obj1.prototype.demo = 123; | |
var obj2 = function () { | |
obj1.call(this); | |
this.name = "yuki"; | |
}; | |
util.inherits(obj2, obj1); | |
console.log(new obj2().color); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment