Created
February 9, 2022 13:36
-
-
Save ahmadabdul3/fda70021afc29e4dcf4b988664b19b63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserModel { | |
user = { | |
firstName: 'Jane', | |
middleName: 'Liz', | |
lastName: 'Doe', | |
}; | |
getFullName({ short } = {}) { | |
const { firstName, middleName, lastName } = this.user; | |
if (short) return firstName + ' ' + lastName; | |
return firstName + ' ' + middleName + ' ' + lastName; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment