6. List em all


#1

syntax error:

var friends = {};
friends.bill = {
firstName: "Bill",
lastName: "Gates",
number: "(555) 555-5555",
address: ['One Microsoft Way', 'Redmond', 'WA', '98052']
},
friends.steve = {
firstName: "Steve",
lastName: "Jobs",
number: "(000) 000-0000",
address: ['One Microsoft Way', 'Redmond', 'WA', '98052']
},
var list = function(friends) {
for (var i in friends)
console.log(i);
};


#2

The syntax error is the use of commas where semi-colons are expected. There are two ways to fix this:

  1. Change the commas; or,
  2. Leave friends block open, and move closing brace to after friends.steve; then remove friends. from each primary key.

var friends = {
    bill: {

    },
    steve: {
    
    }
};

Note the change to bill: and steve: from friends.bill = and friends.steve =.