Senior Backend Engineer / Stage 1 · Foundations

Represent valid input with TypeScript narrowing

Choose oneFoundationDraft, not yet reviewed3 h of activities

"Already know" meets prerequisites. "Not relevant" removes the topic from your total but leaves what builds on it waiting.

Self-check

  • You receive an unknown JSON value expected to contain an order ID and positive quantity. Write a narrowing parser and test a valid object, missing ID, null and negative quantity.
  • Evidence to include: Return an explicit error for each invalid case; explain why a type assertion is insufficient.

Try it without the material first, then compare. Save your answer in your notes below. Report a problem with this self-check

Learning activities

1 activities
  • Not done
    The TypeScript Handbook (opens another site)
    ReadOther sitelink checked 2026-11-13

    The official guide, written to be read top to bottom; Everyday Types and Narrowing are the core of this topic.

    3 h

My notes

Saved on this device, synced when signed in
Esc
↑ ↓ to move↵ to open