Skip to content

Instantly share code, notes, and snippets.

@renderorange
Created July 26, 2018 20:05
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 renderorange/0b187bd9b26c8fb1e67bf7b5d6b420f3 to your computer and use it in GitHub Desktop.
Save renderorange/0b187bd9b26c8fb1e67bf7b5d6b420f3 to your computer and use it in GitHub Desktop.
function Person( first, last ) {
this.firstName = first;
this.lastName = last;
}
Person.prototype.getInitials = function() {
let firstInitial = this.firstName.substring( 0, 1 ).toUpperCase();
let lastInitial = this.lastName.substring( 0 , 1 ).toUpperCase();
return firstInitial + lastInitial;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment