Skip to content

Instantly share code, notes, and snippets.

@mrkaspa
Created October 17, 2014 00:14
Show Gist options
  • Save mrkaspa/594faa544bee3ea5851d to your computer and use it in GitHub Desktop.
Save mrkaspa/594faa544bee3ea5851d to your computer and use it in GitHub Desktop.
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