Predict List Rendering
Predict Output Easy
Question
How many <li> elements are rendered?
Code
const fruits = ["Apple", "Banana", "Cherry"];
<ul>
{fruits.map((fruit, i) => (
<li key={i}>{fruit}</li>
))}
</ul>
Hint
Count the items in the array.
Explanation
The array has 3 items. .map() transforms each into an <li>, producing 3 <li> elements: one for Apple, one for Banana, and one for Cherry.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.