Intermediate
Render a list safely
Write a function renderFruits(names) that replaces everything in #list with one <li> per name, in order.
Names come from users, so they must appear exactly as typed: <b>Kiwi</b> must show the angle brackets, not bold text.
Calling it twice must not duplicate items. The starter already calls renderFruits(fruits) once.
What Check tests
- On load the list shows the three fruits in order
<b>Kiwi</b>is shown as text, not as a bold element- Calling
renderFruitswith new names replaces the list - Calling it twice doesn't duplicate items
- An empty array leaves an empty list
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.