Skip to content

Instantly share code, notes, and snippets.

@BinaryMuse
Last active December 12, 2015 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BinaryMuse/4704412 to your computer and use it in GitHub Desktop.
Save BinaryMuse/4704412 to your computer and use it in GitHub Desktop.
var Parent = require('./parent'),
util = require('util');
var Child = function() {
this.child = 'child';
};
util.inherits(Child, Parent);
Child.prototype.A = function() {
console.log('Child#A');
};
module.exports = Child;
var Child = require('./child');
child = new Child();
child.A();
child.C();
var Parent = function() {};
Parent.prototype = {
C: function() {
console.log('Parent#C');
}
};
module.exports = Parent;
@BinaryMuse
Copy link
Author

Running:

$ git clone https://gist.github.com/4704412.git && cd 4704412
$ node main.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment