I donot understand why


#1


7. Search for a friend


It just says : SyntaxError: Syntax error


address: ['One Microsoft Way','Redmond','WA','98052']
 },
 steve: {
 firstName: "Steve",
 lastName: "Jobs",
 number: "(306) 222-2222",
 address: ['One Apple Blvd', 'Cupertino', 'CA', '95014']
 },
 dan: {
 firstName: "Dan",
 lastName: "Danielson",
 number: "(709) 123-4568",
 address: ['One Mounty Dr', 'Badger', 'NL', 'A0H 0B7']
 },
 harold: {
 firstName: "Harold",
 lastName: "Parsons",
 number: "(478) 000-1111",
 address: ['400 Hog Rd', 'Fayetteville', 'AR', '72704']
 },
 jayram: {
 firstName: "Jayram",
 lastName: "Santaguri",
 number: "(214) 323-4841",
 address: ["24234 Rambo Ct', 'Plano', 'TX', '75075'"]
 }
};
var search=function(name) {
    for(var [firstName] in friends) {
        if(friends[name].firstName === name) {
            console.log(friends[name]);
        }
        else {
            return("Sorry man! Haven't found a thing");
        }
    }
};


#2

Is this your full piece of code?


#3

Yes. You can scroll down and see the complete piece. It keeps returning syntax error


#4

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