One defect per page
Every exercise is a single realistic mistake, in code short enough to hold in your head.
Each page is one realistic defect. Predict what the code does, check your answer, then read why the compiler stayed quiet.
Start with impossible statesEvery exercise is a single realistic mistake, in code short enough to hold in your head.
You commit to an answer first. The explanation only lands once you have been wrong on purpose.
Read, predict and check without signing in. The workout behind each page is where practice continues.
THE EXERCISES
Optional properties describe which fields might exist. A discriminated union describes which combinations are allowed — a much stronger claim.
A default clause is a promise that you have thought about every future case. Almost nobody means to make that promise.
if (value) asks whether a value is truthy. Most of the time you meant to ask whether it was provided.
Requests start in order. Responses do not. Any state update that ignores the difference is a race waiting for a slow network.
A retry is a bet that the same request will behave differently next time. Most failures are not that kind of failure.
Accepting an AbortSignal is a promise to stop. Every await you forget to thread it through is a place where you quietly keep going.
At-least-once delivery is the normal case, not the edge case. "Have I done this already?" is only a useful question if nobody can answer it at the same time as you.
A green async test proves the assertions ran and passed. Plenty of async tests only prove the first half — and some prove neither.
BEYOND THE READING
Each exercise ends in a CodeStamina workout: a specification, a failing test suite and a repair you have to make yourself. One complete guided workout is open without an account.
Open the guided workout