TypeScript — Revision Notes
Condensed summary consolidating this course's Overview, Intermediate, Advanced, and Troubleshooting material — for quick pre-interview review, not first-time learning.
What TypeScript actually is
Superset of JavaScript. Adds a static type system, checked at compile time / in-editor. Structural typing (shape match decides compatibility, not declared name/relationship). Compiles (tsc) down to plain JavaScript — types are 100% erased at that step (type erasure): zero runtime cost, zero runtime benefit, no way to check a type at runtime.
Basic types → Fundamentals
string, number, boolean, null, undefinedinterface vs type: interface merges + extends, object shapes; type aliases name anything (unions/tuples/primitives too), no merging[string, number]) = fixed length + fixed per-position type, distinct from arrays (string[]) = any length, one typeBuilding safely → Intermediate
) preserve the real type through a function/type instead of degrading to anyPartial, Pick, Omit, Record) derive new types that stay in sync automatically if the source type changestypeof/instanceof/tag-field checks let the compiler refine a union within a branch@types/ for third-party JS libraries without their own bundled types; minimal local .d.ts if none exist at allThe genuinely advanced layer → Advanced
T extends X ? A : B — type-level branchinginfer: only inside a conditional's extends clause, extracts a type by pattern match (this is literally how ReturnType works internally)Partial/Readonly/Record are implemented)${...} interpolation at the type level, produces a union of concrete matching stringsinterface blocks, same name, same scope → combine (NOT true for type, which errors on duplicate names)strict: true = bundle of flags, most impactful being strictNullChecks (null/undefined not assignable elsewhere by default) and noImplicitAny (every value needs an inferable/explicit type)skipLibCheck + project references reduce unnecessary re-checkingCommon failure patterns → Troubleshooting
strictNullChecks → handle it for real, don't reflexively reach for ! (non-null assertion, unchecked at runtime)any is contagious — spreads silently to everything downstream that consumes it; prefer unknown + narrowing at genuinely unknown boundariesVersioning Note
TypeScript releases fairly frequently, and several areas are genuinely version-sensitive — treat the following as (needs verification — recheck against current source) rather than assumed-current facts:
@types package version compatibility for any specific third-party libraryThe core language concepts covered above — structural typing, generics, interfaces, type erasure, discriminated unions — have been stable for years and are safe to treat as durable, not volatile.

