Command Palette

Search for a command to run...

Hectal
Phase 15: Interviews and Capstone
AI Frontend · Exercise 3 of 6 PreviousNext
Intermediate

Ignore the Stale Answer

Two buttons ask Mitra a question: #slow and #fast. The slow question's answer is held on the server until #release is pressed. Right now, if you press #slow, then #fast, then #release, the slow answer overwrites the fast one in #answer.

Fix it: when a new question starts, abort the previous request. An aborted request must not change #answer and must not show an error. After the fix, #answer says Answer to the fast question. and stays like that after #release.

What Check tests

  1. After slow then fast, #answer shows the fast answer
  2. After the slow answer is released, #answer still shows the fast answer
  3. No error message is shown for the aborted request

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.