Skip to content
Advertisement

printing arry of object in object in Html from JS and Json

I have an array in JSON, I need to pass it in JS that its printing will be like the image in HTML After trying to print to console.log – it really prints in order It’s just that during the creation of the HTML elements everything was a mess

This is my array:

JavaScript

And I want it to be printed as in the picture, enter image description here

Each square is a DIV I would love to get help from infected people like you, I’m desperate already

Advertisement

Answer

You can programmatically render each object and recursively render each of its children :

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement