
Choose a concept
Choose an available lesson on narrowing, generic types, tuples, or conditional types. Identify the input type and the result you want.
ExampleGiven a result union with kind: success or kind: failure, state which fields are safe to use inside each branch.
Trace and explain
Complete the lesson drill and explain why an assignment or expression should type-check. Revisit prerequisites if you cannot justify the rule.
ExampleFor a generic first-element helper, predict the difference between an empty array and a fixed nonempty tuple.
Apply it in practice
Open a related type challenge and preserve the starter’s assertions. Use the available type checks and inspect the first diagnostic.
ExampleFor a mapped-type exercise, check whether optional and readonly modifiers are preserved as the contract requires.
Check your work
You can explain a worked example and use the same rule on a new input or exercise.
Try it yourself
Design a union with kind: loading, kind: success, and kind: failure. Give only the success branch a value and only the failure branch a message. In a type exercise, narrow by kind before using either field.
- What to look for
- The loading branch permits neither field. A direct access without narrowing should fail if the field is absent from any member of the union.