6/8 Unexpected Token Var


#1

I've gone over this code multiple times and even made changes that resolved it for other people. Yet i still cant solve . need help please. Also sorry for how this looks its my first time posting

    var friends = {
        paul: {
            firstName: "Paul",
            lastName: "Mcintosh",
            number : "its a secret",
            address: [' that one place', ' in that one town' , ' someplace ', 'somewhere']
                
            },
        marcus: {
            firstName: "Marcus",
            lastName: "Clark",
            number : "its a secret",
            address: [' that one place', ' in that one town' , ' someplace ', 'somewhere']
            },
        bill: {
            firstName: "Bill",
            lastName: "Gates",
            number: "(206) 555-5555",
            address: [' that one place', ' in that one town' , ' someplace ', 'somewhere']
            },
        steve: { 
            firstName: "Steve",
            lastName: "Jobs",
            number : "its a secret",
            address: [' that one place', ' in that one town' , ' someplace ', 'somewhere']
            }
};
            
    var list = function (friends) {
    for (var firstName in friends) {
    console.log(firstName)
    }
   };

#2

Hey @mykk! Simple fix! You forgot to close your Friends object/array :smile: . So add a } after steve.


#3

I tried and it didnt work for me. Also I'm confused on what you mean.


#4

I mean. Wait ill show you practicaly:

var friends = {
paul: {
firstName: "Paul",
lastName: "Mcintosh",
number : "its a secret",
address: [' that one place', ' in that one town' , ' someplace ', 'somewhere']

    },
marcus: {
    firstName: "Marcus",
    lastName: "Clark",
    number : "its a secret",
    address: [' that one place', ' in that one town' , ' someplace ', 'somewhere']
    },
bill: {
    firstName: "Bill",
    lastName: "Gates",
    number: "(206) 555-5555",
    address: [' that one place', ' in that one town' , ' someplace ', 'somewhere']
    },
steve: { 
    firstName: "Steve",
    lastName: "Jobs",
    number : "its a secret",
    address: [' that one place', ' in that one town' , ' someplace ', 'somewhere']
    }
//<< -- Add another Bracket here!

#5

it tells me unexpected token }
sorry for the confusion


#6

I see why you were saying that my friend object array was closed. It wasnt showing in the box but i have code below it that closes it.

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

Sorry about that. Im new to forum posting.