Created
May 14, 2016 02:12
-
-
Save AndresEdoc90/38e1f0ff88ec91115b42af449e2af16a 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
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