TypeScript

Type-safe JavaScript with TypeScript

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

Build a Type Safe Object Keys Helper

Build a generic helper that returns the keys of an object with precise types instead of string[]. Combine keyof, generics, and type assertions for safer iteration and lookup.

TypeScript
Jul 17, 2026· 5 min read

Common Generic Type Mistakes in TypeScript

Avoid the most frequent generic type mistakes in TypeScript. Learn to spot unnecessary type parameters, missing constraints, runtime type checks, and overly complex generics.

TypeScript
Jul 17, 2026· 6 min read

Create a tsconfig File

A tsconfig.json file tells TypeScript how to compile your project. Learn how to create one, what the key sections mean, and which options to set first.

TypeScript
Jul 17, 2026· 7 min read

Conditional Types in TypeScript

Conditional types let you write type-level if/else logic that picks different output types based on the input. Learn the syntax, how to constrain generics, and practical patterns.

TypeScript
Jul 17, 2026· 7 min read

Infer Keyword in TypeScript

The infer keyword captures a piece of a type during a conditional check so you can use it in the true branch. Learn how to extract return types, array elements, and promise values.

TypeScript
Jul 17, 2026· 7 min read

Distributive Conditional Types in TypeScript

When a conditional type receives a union, TypeScript distributes the check over each member. Learn how distribution works, when to use it, and how to disable it.

TypeScript
Jul 17, 2026· 7 min read

Recursive Types in TypeScript

Recursive types reference themselves to describe nested or self-similar structures like trees, linked lists, JSON, and deeply nested arrays or promises.

TypeScript
Jul 17, 2026· 6 min read

Branded Types in TypeScript

Branded types add compile-time tags to primitives so TypeScript can tell apart values that share the same underlying type, like UserId and OrderId.

TypeScript
Jul 17, 2026· 6 min read

Satisfies Operator in TypeScript

The satisfies operator validates that a value matches a type without changing the value's inferred type. Use it to catch errors while keeping precise type information.

TypeScript
Jul 17, 2026· 6 min read

Const Type Parameters in TypeScript

The const modifier on type parameters tells TypeScript to infer the most specific type, like as const but automatic. Added in TypeScript 5.0.

TypeScript
Jul 17, 2026· 7 min read

Build a DeepReadonly Type in TypeScript

Build a recursive type that makes every nested property readonly. Learn how to combine mapped types, conditional types, and recursion into one reusable utility.

TypeScript
Jul 17, 2026· 7 min read

When Advanced Types Become Too Complex

Advanced TypeScript types are powerful but can become unreadable and slow. Learn the warning signs and how to simplify before your types hurt more than they help.

TypeScript