Created
December 23, 2013 08:45
-
-
Save scribblet/8093612 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
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compare with module/constructor patterns.