Typed Explorer Step 5: Make the Impossible Unrepresentable

Go through your Explorer's state and find every value that can legitimately be absent. Type each one honestly as a union with null or undefined, rather than pretending it is always there. The compiler will now object in every place you were not handling it, and each objection is a bug you shipped. Fix them by narrowing, not by adding assertions. Count how many there were, because that number is the argument for this whole course.

SANKOFA SANDBOX
loading editor…
Your turn → Work through it step by step. This is a piece of the course project, not a throwaway exercise.

Built it in both languages?

Mark it done once your Python and JavaScript versions both run correctly. Honesty here is what makes the dashboard useful to you.

← BackNext: Module 6: Discriminated Unions →