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
- After slow then fast,
#answershows the fast answer - After the slow answer is released,
#answerstill shows the fast answer - 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.