TypeScript

Type-safe JavaScript with TypeScript

187 tutorials
12 of 187 tutorials
Jul 17, 2026· 7 min read

String Number and Boolean Types in TypeScript

TypeScript's string, number, and boolean types map directly to JavaScript primitives. Learn how to use each one, what values they accept, and common mistakes to avoid.

TypeScript
Jul 17, 2026· 7 min read

Enums in TypeScript Explained

An enum is a way to define a set of named constants in TypeScript. Learn numeric enums, string enums, const enums, and when to use enums versus union types.

TypeScript
Jul 17, 2026· 8 min read

Common TypeScript Beginner Mistakes

New TypeScript developers make the same mistakes: skipping parameter types, overusing any, and forgetting that types disappear at runtime. Learn to spot and fix the most frequent errors.

TypeScript
Jul 17, 2026· 5 min read

Let and Const in TypeScript

TypeScript infers different types for let and const. Learn how block scoping changes type inference, why const gets literal types, and when to choose each.

TypeScript
Jul 17, 2026· 5 min read

TypeScript Literal Types Explained

A literal type is a type that represents exactly one value. Learn how string, number, and boolean literal types work, why they matter with union types, and when to use const assertions.

TypeScript
Jul 17, 2026· 5 min read

Type Widening in TypeScript

Type widening is how TypeScript expands a narrow inferred type into a wider, more general one. Learn when widening happens, why let widens but const does not, and how to control it.

TypeScript
Jul 17, 2026· 6 min read

Type Narrowing Basics in TypeScript

Type narrowing is how TypeScript refines a wide union type to a more specific one based on runtime checks. Learn typeof, truthiness, equality, and in-operator narrowing.

TypeScript
Jul 17, 2026· 5 min read

Readonly Values in TypeScript

Readonly values in TypeScript prevent accidental mutation. Learn readonly properties, ReadonlyArray, readonly tuples, the Readonly utility type, and how readonly differs from const.

TypeScript
Jul 17, 2026· 5 min read

Assignment Compatibility in TypeScript

TypeScript uses structural typing to decide if one type can be assigned to another. Learn the rules of assignment compatibility for objects, functions, and primitives.

TypeScript
Jul 17, 2026· 5 min read

When to Add Type Annotations in TypeScript

TypeScript can infer types in many places, but some spots always need annotations. Learn when inference is enough and when you must write types explicitly.

TypeScript
Jul 17, 2026· 5 min read

Rest Parameters in TypeScript

A rest parameter collects any number of remaining arguments into a typed array. Learn the ... syntax, how to type rest parameters, and the difference between rest parameters and spread arguments.

TypeScript
Jul 17, 2026· 7 min read

Common Runtime Type Mistakes in TypeScript

TypeScript types disappear at runtime, and the most common mistakes happen when developers forget this. Learn the pitfalls of typeof, instanceof, type assertions, and structural checking so you stop trusting types at runtime.

TypeScript