Skip to content

Instantly share code, notes, and snippets.

@TheSavior TheSavior/person.js Secret
Created Jun 11, 2015

Embed
What would you like to do?
CommonJS Classes Person
function Person(name) {
this.name = name;
}
Person.prototype = {
setName: function(name) {
this.name = name;
},
speak: function() {
console.log('Hi, my name is ' + this.name);
}
}
module.exports = Person;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.