Command Palette

Search for a command to run...

Hectal
Phase 15: Interviews and Capstone
AI Frontend · Exercise 2 of 6 PreviousNext
Beginner

Only Safe Links

#links must list the links from the links array. A link whose address starts with https: or mailto: becomes a real <a> with rel="noopener noreferrer". Any other link (like javascript:) must not become an <a>: show only its label as plain text in the <li>.

Use new URL(url, base).protocol to decide, not a text check on the start of the string.

What Check tests

  1. There are three list items
  2. Exactly two of them contain a link
  3. Every link has rel with noopener
  4. The blocked label is still shown as text

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.