function lookUpProfile(firstName, prop){
// Only change code below this line
var i = “”;
var k = “”;
var result = “”;
// loop through the array of profiles
for (i = 0; i < contacts.length; i++) {
// if the firstName parameter is equal to the firstName key in the object, carry on to next step, else return no such contact.
if (contacts[i].firstName == firstName) {
// the name matches, now loop through the object keys to find if the prop parameter matches.
for (k = 0; k < contacts[i].length; k++) {
//if the prop parameter matches a key in the object, result is equal to the key's value
if (contacts[i].hasOwnProperty(prop) === true) {result = contacts[i][prop];}
//if the prop matches nothing result is equal to no such property.
else {result = "No such property";}
}
}
else {result = "No such contact";}
}
//return the result of our search
return result;
// Only change code above this line
}
// Change these values to test your function
lookUpProfile(“Sherlock”, “lastName”);