我试图将一些对象变成对象,但是我的语法存在问题。
代码:
var friends = {
bill : {
firstName:"Bill",
lastName:"Gates",
number:00158965478
},
steve :{
firstName:"Steve",
LastName:"Jobs"
number:00125688977
},
Joe: {
firstName:"Joe",
LastName:"Erabti",
number:0021625804429
}
};
答案 0 :(得分:0)
你忘记了乔布斯的姓氏之后的逗号。所以它假设是这样的:
var friends = {
bill : {
firstName:"Bill",
lastName:"Gates",
number:00158965478
},
steve :{
firstName:"Steve",
LastName:"Jobs", //<-- You previously forgot it here
number:00125688977
},
Joe: {
firstName:"Joe",
LastName:"Erabti",
number:0021625804429
}
};