Adding properties(Please tell me, why is using a colon wrong over here, and where exactly is not supposed to be used.Thanks in advance.)


#1



https://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/4?curriculum_id=506324b3a7dffd00020bf661#


SyntaxError: Unexpected token :


var friends = {
    bill: {
        firstName: "Bill",
        lastName: "Gate",
        number: "(109) 335 2890"
    }
};
    steve: {
        firstName: "Steve",
        lastName: "Jobs",
        number: "(102) 245 5460"
    }
};


#2

var friends = {
bill: {
firstName: "Bill";
lastName: "Gate";
number: "(109) 335 2890"
}
};
steve: {
firstName: "Steve";
lastName: "Jobs";
number: "(102) 245 5460"
}
};

this work?


#3

both bill and steve should be in your friends object. But you already close your friends object after bill. You should also seperate the bill and steve object with a comma (,):

bill: {
        firstName: "Bill",
        lastName: "Gate",
        number: "(109) 335 2890"
    }, /* , missing in your case */
    steve: {

#4

Thanks a lot, Yes, I realised I closed the object after bill.... Thank you soooo much! :smile:


#5

Hey, Like stetim94 said, I closed the object after bill.... which was causing issues... thanks for the help though! :slight_smile: