Consider the JSON object shown below:
var workers = { "finance" : [ // finance is an array in workers.
{ "firstName" : "Alice", // First element
"lastName" : "Smith",
"age" : 28 },
{ "firstName" : "Tom", // Second Element
"lastName" : "Brown",
"age" : 35 }
], // End "finance" array.
"marketing" : [ // Marketing is another array in employees.
{ "firstName" : "Linda", // First Element
"lastName" : "Taylor",
"age" : 30 },
{ "firstName" : "Kevin", // Second Element
"lastName" : "Jones",
"age" : 39 }
] // End "marketing" Array.
} // End Workers
To access each employee's first name individually, you need to restructure the object as follows:
workers.finance[0].firstName
workers.finance[1].firstName
// etc