In my current setup, I am utilizing a nested array with the following organization:
arr[0]["id"] = "example0";
arr[0]["name"] = "name0";
arr[1]["id"] = "example1";
arr[1]["name"] = "name1";
arr[2]["id"] = "example2";
arr[2]["name"] = "name2";
My goal now is to extract a nested JSON Object from this array
arr{
{
id: example0,
name: name00,
},
{
id: example1,
name: name01,
},
{
id: example2,
name: name02,
}
}
I had initially attempted to achieve this with JSON.stringify(arr);
, however, it proved to be unsuccessful. If anybody has a solution, please share as I would greatly appreciate it.
Thank you!