Skip to content
Advertisement

Why I cannot map over this array of objects in React JS?

Why I cannot map over this array of objects in React JS?

Here’s my code:

JavaScript

The code in quotations is working but map is not.

Advertisement

Answer

You are missing a return statement on the map so you are not able to get the output.

You can do it as follows.

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