I’m afraid I don’t understand something related to this challenge.
This IF statement renders true, and returns half of the challenge as correct.
for (i = 0; i < contacts.length; i++){
if (contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop)){
return contacts[i][prop];
}
}
BUT, when I add an ELSE statement, the first half is not true anymore
for (i = 0; i < contacts.length; i++){
if (contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop)){
return contacts[i][prop];
}else {
return "whatever";
}
}
So my question, if an If statement is once seen as TRUE, how can an Else statement render it FALSE?