Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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