Why i find error?the code can't pass.please help me


#1


Replace this line with your code.


#2

Could you post your code along with your error? Thanks!


#4

i made another code but couldn't pass too.

var friends={};
friends.bill={
firstName:'Bill';
lastName:'Gates';
number:'(206)-555-5555';
address: ['One Microsoft Way','Redmond','WA','98052'];
};
friends.steve={

firstName:'Steve';
lastName:'Jobs';
number:"(408) 555-5555";
address: ['1 Infinite Loop','Cupertino','CA','95014'];
};
var list = function(obj){
for(var prop in obj) {
console.log(prop) ;
}}
var search =function(name){
for(var prop in friends) {

  if (friends[prop].firstName===name){
     console.log(friends[prop]);
     return friends[prop];
      } 
    }

};
list(friends)} ;
search("steve");

SyntaxError: missing } after property list


#5

Try using commas instead of semicolons to separate your properties.

You have a curly bracket here that might be the reason for your error message.


#6

thank you.it helps me.the code passed.


#7

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