Skip to content

Instantly share code, notes, and snippets.

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 AndresEdoc90/38e1f0ff88ec91115b42af449e2af16a to your computer and use it in GitHub Desktop.
Save AndresEdoc90/38e1f0ff88ec91115b42af449e2af16a to your computer and use it in GitHub Desktop.
function lookUpProfile(firstName, prop){
// Only change code below this line
for ( var i = 0; i < contacts.length; i++){
if (firstName === contacts[i].firstName && contacts[i].hasOwnProperty(prop)){
return contacts[i][prop];
}
/*if (firstName !== contacts[i].firstName){
return "No such contact";
}
if ( prop !== contacts[i][prop]){
return "No such property";
}*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment