Skip to content
Advertisement

What method to use to access multiple objects in an array?

I’m new to javascript and still learning them.

So I was building a project where I want to display a multiple object, which I put it in an array, to the DOM. I am not sure what method to use to access the object inside the array.

JavaScript

This is my js file:

JavaScript

So I kind of want to display all the objects in the DOM. Is it necessary to put the objects in the array first? What methods do I use to return a list in the file? Or do you know any easier methods to display all the objects in the DOM?

Thank you so much for the help.

Advertisement

Answer

Maybe you can try something like this :

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