I think I got it but the code is not running js profile lookup challenge

function lookUpProfile(name, prop) {
// Only change code below this line
for (let x = 0; x < contacts.length; x++){
if (contacts.firstName === name && contacts.hasOwnProperty(prop)) {
return contacts[prop];
} else {
return “No such property”
}
} return “No such contact”

// Only change code above this line
}

Please fix your code so that it displays in here properly using the method below.

To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key. You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.

Also, a link to the challenge is always helpful.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.