Convert JSON objects to JSOn array

Hi I have below data [object][object],[object][object],[object][object],[object][object]… etc

So I want this all data in array format

[[object][object],[object][object],[object][object],[object][object]… etc]

I used push() but it is not working. please help me.

in simple words you must first convert your object into a json if it is in html format, if this is already an object as samples you can skip the JSON.parse assignment (resultData); and traverse the object as I place below:

dataPush = [ ’ ];

var data = JSON.parse (resultData);

Object.keys (data) .forEach (key =>
this.dataPush.push ({value: data [key] [“dateEnd”], description: data [key] [“dataDescription”]});

What you finally do is go through the nodes of the object and in another variable go saving it in another arrangement according to your needs so that later you can go through the html side

1 Like

This would likely be a much more productive conversation if you would post actual JSON instead of pseudo-JSON.

Thayou for your reply. it is working fine now.

I am glad that it has served you, remember that if the answer was correct, do not forget to mark it as a solution.

Greetings and happy new year

1 Like

Where should I mark it as a solution