Command Palette

Search for a command to run...

Hectal
Phase 3: Conditions and Lists
React · Exercise 2 of 5 PreviousNext
Beginner

Render a list from data

Render every planet in the planets array as an <li> inside the <ul id="planets">, in the same order.

Each item's text must be exactly Name: N moons, for example Earth: 1 moons.

Use map and give each item a proper key, so the console shows no key warning.

What Check tests

  1. The list has 4 items
  2. The items read Name: N moons in order
  3. The list is made with map
  4. No missing-key warning in the console

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.