Skip to content

Instantly share code, notes, and snippets.

@gchaturvedi
Created November 13, 2014 16:10
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 gchaturvedi/a86babb2330ff340a9b0 to your computer and use it in GitHub Desktop.
Save gchaturvedi/a86babb2330ff340a9b0 to your computer and use it in GitHub Desktop.
function Person(name) {
this.name = name;
}
Person.prototype = {
constructor: Person, // does not doing this line have any consequences?
sayName: function() {
console.log(this.name); },
toString: function() {
return "[Person " + this.name + "]";
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment