Skip to content

Instantly share code, notes, and snippets.

@TheSavior
Created June 11, 2015 16:53
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 TheSavior/53dac2db3d76f1d2a770 to your computer and use it in GitHub Desktop.
Save TheSavior/53dac2db3d76f1d2a770 to your computer and use it in GitHub Desktop.
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