Command Palette

Search for a command to run...

Hectal
Phase 16: Dashboards in Production
Data Visualization · Exercise 3 of 5 PreviousNext
Intermediate

Keep the newest message

Messages for one station arrive out of order. Each has a seq number. apply(state, message) must keep the message with the highest seq and ignore older or repeated ones.

The page prints the final bike count for each station. Station A should end on 12 and station B on 7.

What Check tests

  1. Station A ends on 12
  2. Station B ends on 7
  3. The late and repeated messages are reported

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.