Created
July 12, 2019 04:49
-
-
Save DennyScott/ffcea61b454280263732853d7b221d61 to your computer and use it in GitHub Desktop.
This file contains 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
const personOne = { | |
firstName: “Denny”, | |
lastName: “Scott”, | |
contact: { | |
phoneNumber: 555–555–5555, | |
twitter: “ | |
@gitinbit” | |
} | |
} | |
function getUserForPhoneDirectory(person) { | |
if(person && person.firstName && person.lastName && person.contact && person.contact.phoneNumber) { | |
return `${person.firstName} ${person.lastName} — ${person.contact.phoneNumber}` | |
} | |
} | |
getUserForPhoneDirectory(personOne); //expect: Denny Scott — 555–555–5555 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment