Command Palette

Search for a command to run...

Hectal
Phase 13: Cost, Limits and Production
AI Frontend · Exercise 5 of 6 PreviousNext
Advanced

Log Only What Is Allowed

Each click on #fire sends the next event to your track(props) function and prints what you decided to keep on a new line of #logged as JSON. ALLOWED lists the keys and the values each may have.

Write track so it keeps only allowed keys with allowed values. For the first event the line must be {"outcome":"answered","ttft":"fast"}. For the second it must be {"outcome":"failed"}: a raw number like 812 is not an allowed ttft value.

What Check tests

  1. The first event keeps only outcome and ttft
  2. The second event drops the raw 812
  3. Nothing the user typed or their email appears in the log

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.