I want to create an object with nested arrays that will look something like this:
[{"name":"Joe","role":["Admin","Developer"]},{"name":"Sherry","role":["Analyst","QA-tester"]}]
I want to be able to do things like find the roles array for Sherry and add more values to that array. How can I go about this?
employees = [];
// [*query database for names and associated roles*]
employees.push({name: exampleVar1,role:exampleVar2});
Expected results: I want to store names that I can use to insert roles associated to the employee. Then later use this object as a reference.