我正在尝试创建以下内容:
var employees = {"accounting": [ // accounting is an array in employees.
{ "firstName" : "John", // First element
"lastName" : "Doe",
"age" : 23 },
{ "firstName" : "Mary", // Second Element
"lastName" : "Smith",
"age" : 32 }
] // End "accounting" array.
} // End Employees
我开始:
var employees=new Array();
如何继续动态附加到数组(可能会用变量更改 firstName)?