6. List 'em all!


#1


alright, code looks like it should, but i got a syntax error......

"SyntaxError: missing } after property list"


var friends = new Object();
friends.steve = {};
friends.bill = {};

var friends = {
    bill: {
        firstName: "Bill",
        lastName: "Gates",
        number: "(206) 555-5555",
        address: ['One Microsoft Way', 'Redmond', 'WA', '98052']
    }
    steve: {
         firstName: "Steve",
         lastName: "Jobs",
         number: "(314) 159-2524",
         address: ["666 Hell Street", "Hades", "OK", "43210"]
    }
}

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


#2

Object literals are properties separated by comma and end with }

You have 5 such literals in your code, so it's quite feasible to just check them all by eye. You can also run them in another js interpreter as that'll probably get you a line number


#3

var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number: "(206) 555-5555",
address: ['One Microsoft Way', 'Redmond', 'WA', '98052']
} <<------ You are missing a comme here to separate them
steve: {
firstName: "Steve",
lastName: "Jobs",
number: "(314) 159-2524",
address: ["666 ■■■■ Street", "Hades", "OK", "43210"]
}


#4

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