React · Junior · Question 41 of 75

How do you render a list of users from the users array?

Explanation

map returns a new array of elements that React renders. forEach returns undefined, so nothing appears. for is a statement and can't be written inside {}. And don't forget key.

Further reading

Problem with a question

React · Junior · question 41

Test yourself

Take the React · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz