12/7 Where does it expect a semi-colon (;)?


#1

Link to where I'm stuck:

https://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/7?curriculum_id=506324b3a7dffd00020bf661#

Guess I'm back at the forums. (You guys are really helpful, you know.) Now I am trying to search through my "Database" to find Bill, but good 'ol Codecademy says it is expecting a semi-colon:

SyntaxError: Expected ';'

I'm positive that I've put all the necessary semi-colons, but apparently not. Also, If you find more flaws of my n00bish ability, please bring it to light. Here is my code:

var friends = {
    bill: {
        firstName: 'Bill',
        lastName: "a'Bong",
        number: '(850) 333-3333',
        address: ["Pensacola","FL"]
    },
    steve: {
        firstName: 'Steve',
        lastName: 'Alicious',
        number:'(123) 456-7891',
        address: ['Virginia Beach','VA']
    }
};

var list = function(friends) {
    for (var lastName in friends) {
       console.log(lastName)
    }
};

var search = function(name) {
    for (var firstName in friends) {
        if(friends[bill].firstName === Bill) {
            console.log(friends[bill]);
            return friends[key]);
        }
    }
};

#2

Run your code in a different interpreter (your browser, some online one, or nodejs) to get a line number

Also, both printing and returning a result is rather strange behavior


#3

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