Skip to content

Instantly share code, notes, and snippets.

@scribblet
Created December 23, 2013 08:45
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 scribblet/8093612 to your computer and use it in GitHub Desktop.
Save scribblet/8093612 to your computer and use it in GitHub Desktop.
var Engine = require('engine');
var Car = function(name) {
this.name = name;
this.engine = new Engine(5);
}
Car.prototype.toString = function() {
return 'Car called ' + this.name + ' with engine power ' + this.engine.power + '.';
};
module.exports = Car;
@scribblet
Copy link
Author

Compare with module/constructor patterns.

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