Learning TypeScript: Enhance Your Web Development Skills Using Type-Safe JavaScript
Best for: JavaScript developers with no prior type-system experience who want a structured, chapter-by-chapter onboarding to TypeScript.
- ISBN-13: 9781098110338
- Level: beginner
- Published: 2022
Josh Goldberg maintains typescript-eslint, and it shows in how carefully
this book sequences ideas: it starts from the assumption that the reader
knows JavaScript but has never had a compiler tell them anything about their
code before, and only introduces a new concept once the previous one has
been used enough to feel natural. The early chapters on type inference and
control-flow narrowing spend real time on why TypeScript can tell what a
variable is at a given point in the code, which pays off once generics and
union types show up later.
Its strongest chapter is the one on configuring tsconfig.json and
understanding what each strictness flag actually catches — most beginner
material treats the config file as boilerplate to copy-paste, but this book
walks through strictNullChecks, noImplicitAny, and friends one at a
time with concrete examples of the bugs each one prevents. That turns
“turn on strict mode” from cargo-culted advice into something a reader
understands well enough to configure deliberately on their own projects.
Where it’s weaker: advanced type-level programming — conditional types, mapped types, template literal types — gets a single chapter near the end, which is appropriately paced for a beginner book but means readers who finish it still have a lot to learn before they can write library-grade generic types. Being a 2022 book, it also predates a few newer language features and doesn’t reflect the latest TypeScript release’s inference improvements.
Compared to Effective TypeScript: this is the book to read first if you’ve never used a type system — it teaches the mental model from zero. Effective TypeScript assumes that grounding already exists and instead corrects the habits a reader picks up once they’re writing real TypeScript day to day.