Skip to content

Instantly share code, notes, and snippets.

@codeaholicguy
Created December 21, 2015 10:58
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 codeaholicguy/c137cef2b98737100fc3 to your computer and use it in GitHub Desktop.
Save codeaholicguy/c137cef2b98737100fc3 to your computer and use it in GitHub Desktop.
function Person(lastName, firstName) {
this.firstName = firstName;
this.lastName = lastName;
}
Person.prototype.toString = function personToString() {
return this.firstName + ' ' + this.lastName;
}
var person = new Person('Hoang', 'Nguyen');
console.log('The person is ' + person);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment