Created
June 24, 2012 00:29
-
-
Save austinbv/2980715 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 Person = require('./person'); | |
> var p = new Person.Person(); | |
> p | |
{ name: 'austin', age: 0 } | |
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 Person = module.exports.Person = function() { | |
this.name = "austin"; | |
this.age = 0; | |
}; | |
Person.prototype.haveBirthday = function(){ | |
this.age += 1; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment