I want to add more nested "if statements" in the succeeding lines but I don't know what to do while using ternary operator.
Object.freeze (phoneBook)
function lookup(name, address) {
for (let i = 0; i < phoneBook.length; i++)
{
return (phonebook[i].givenName === name)? phoneBook[i][address]: "Not in the phonebook";
}
Aucun commentaire:
Enregistrer un commentaire