What is wrong with code? help please


#1



There was a problem with your syntax.
SyntaxError: Unexpected token .


var friends = {};
friends.bill = {
    bill.firstName: "Bill",
    bill.lastName: "Clinton",
    bill.number: "(555) 654-424"};
friends.steve = {
    steve.firstName: "Steve",
    steve.lastName: "McClaren",
    steve.number: "(307) 444-512"};
friends.john = {
    john.firstName: "John",
    john.lastName: "Dillinger",
    john.number: "(490) 316-766"}
};


#2

You have an unneeded curly brace and semicolon at the end. :slight_smile:


#3

i deleted them but code is still wrong(

var friends = {};
friends.bill = {
bill.firstName: "Bill",
bill.lastName: "Clinton",
bill.number: "(555) 654-424"};
friends.steve = {
steve.firstName: "Steve",
steve.lastName: "McClaren",
steve.number: "(307) 444-512"};
friends.john = {
john.firstName: "John",
john.lastName: "Dillinger",
john.number: "(490) 316-766"}


#4

You don't need to specify bill.firstName, just firstName.


#5

it worked out. but now another problem is that, it shows only the last friends datas, not first and second friends'...