Please I can't find my mistakes with Profile Lookup!

Tell us what’s happening:
I tried everything, reset a couple times, and this will not run…
Is it still “undefined”, I don’t see a problem?

Your code so far


//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["JavaScript", "Gaming", "Foxes"]
    }
];


function lookUpProfile(name, prop){
// Only change code below this line
    ```
for (var i = 0; i < contacts.length; i++) {
        if (firstName === contacts[i].firstName)
        if (contacts[i].hasOwnProperty(prop) === true) {
            return contacts[i][prop];
        } else {
            return "No such property";
        }
    }
return "No such contacts";
// Only change code above this line
}
//  moved return "No such contacts";
// Change these values to test your function
lookUpProfile("Akira", "likes");

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/profile-lookup/

I’m back to firstName not defined?

The following question is the reason I used it:
the function should check if name is an actual contact’s firstName and the given property(prop) is a property of that contact
I worked on it and reset so many times it does not Run the Test.
I’m past firstName not defined, and lost it with “Bob’s” potato and number.

Thank You randelldawson, for your guidance.
I’m going to take a break from this, change what I’m working on and come back to this later (refreshed). :slight_smile:

Thank You !
I will with a fresh new start after my break. :wink: