Everytime I think I'm getting the hang of this, something else comes up :)

Everytime I think I'm getting the hang of this, something else comes up :)

So... I figured out how to add items to a pre-existing array. Following is the applicable script snippet:

  1. catch_array["privilegesID"] = []; // Declare a new associative key in the catch_array.
  2. catch_array.privilegesID.push(varPrivilegesID); // Add varPrivilegesID to catch_array, assign it to the associative key.
  3. console.log("data row After processing: " + JSON.stringify(catch_array));
It works great, except for one issue. When I run it to the console.log the added array items do not output the same way as items that have been in the array all along. A sample output follows:

  1. [{"CrossRefID":"50917","BookOwner":"5","AddressOwner":"53284","UserGroup":"Admin","Active":"1","privilegesID":["2"]}]
Notice the [] brackets around the ["2"]. Those square brackets only surround values of the new Associative Key that I pushed into the array.

How do I get rid of the [] brackets?

Thanks in advance - Pavilion