Phase 03TypeScript as a design tool161 of 434
Narrowing is most of the language
typeof, in, instanceof, literal checks, type predicates and assertion functions, applied to data that genuinely arrives in four shapes.
Build40 minAI adversary
Build this in your own editor
This one runs on your machine rather than in the browser workbench. Work to the outcomes below, then come back and mark it complete.
You should now be able to
- Narrow a union through control flow without a cast
- Write a type predicate that is actually sound
Loading…