var bob = {
firstName: "Bob",
lastName: "Jones",
phoneNumber: "(650) 777-7777",
email: "[email protected]"
};
var mary = {
firstName: "Mary",
lastName: "Johnson",
phoneNumber: "(650) 888 - 8888",
email: "[email protected]"
};
var contacts =['bob', 'mary'];
console.log(contacts[1]);
如上,我想输出 contacts数组里面的mary的phoneNumber,该用什么办法呢?