Display an object inside HTML

Good evening everyone.

In the above project I have an object that has a movie title as a key and each movie has an object with details about the movie.

I would like to display each movie inside the HTML but for now, I displayed each title converting it from object to array.

The 2nd step is to print all values (movie details) but I am not sure if I need another loop. (I tried to use Object.entries again but I still could not make it work.

My question is in line 42, ul.innerHTML = ${key} ${value} is not valid because ‘value’ it’s an object.

If you want to get all the property values of the value object, you will need to iterate through them also.

Also, keep in mind that ul elements should only have li elements as children. You should not have other text content within the ul unless it is within an li element.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.