TypeScript

Type-safe JavaScript with TypeScript

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

Type JavaScript with JSDoc

Learn how to add type annotations to JavaScript using JSDoc comments. Cover @type, @param, @returns, @typedef, @template, and how TypeScript reads them.

TypeScript
Jul 17, 2026· 6 min read

Promises in TypeScript Explained

Learn how TypeScript types promises so you can write async code with confidence. Covers Promise<T>, then/catch chains, and how the compiler catches common async mistakes.

TypeScript
Jul 17, 2026· 6 min read

Async and Await in TypeScript

Learn how async and await work with TypeScript's type system. Covers async function return types, typed await expressions, and error handling with try/catch.

TypeScript
Jul 17, 2026· 7 min read

Type Promise Return Values

Learn to type what a promise resolves to in TypeScript. Covers explicit Promise<T> annotations, inference from async functions, ReturnType, and Awaited for extracting resolved types.

TypeScript
Jul 17, 2026· 8 min read

Build a Typed Fetch Wrapper

Build a generic fetch wrapper in TypeScript that adds type-safe request and response handling. Learn to type URL parameters, request bodies, and parsed JSON responses.

TypeScript
Jul 17, 2026· 7 min read

Type API Response Data in TypeScript

Learn to model API response types in TypeScript. Covers JSON response shapes, optional fields, discriminated unions for states, and narrowing unknown data from external APIs.

TypeScript
Jul 17, 2026· 7 min read

Handle API Errors in TypeScript

Learn to type and handle API errors safely in TypeScript. Covers error narrowing, discriminated result types, status-code handling, and typed error boundaries.

TypeScript
Jul 17, 2026· 7 min read

Use Promise All in TypeScript

Learn to use Promise.all with TypeScript's type system. Covers typed tuple results, Promise.allSettled for partial failures, and avoiding common type pitfalls.

TypeScript
Jul 17, 2026· 7 min read

Cancel Async Requests in TypeScript

Learn to cancel in-flight async requests using AbortController with TypeScript types. Covers AbortSignal, fetch cancellation, cleanup patterns, and typed error handling.

TypeScript
Jul 17, 2026· 7 min read

Retry Failed API Requests with TypeScript

Build a typed retry wrapper in TypeScript with exponential backoff. Learn to type retry configuration, handle transient failures, and preserve response types across retries.

TypeScript
Jul 17, 2026· 7 min read

Common Async TypeScript Mistakes

Avoid the most common async TypeScript mistakes. Covers floating promises, missing error handling, Promise.all pitfalls, and async function misunderstandings.

TypeScript
Jul 17, 2026· 6 min read

Partial Utility Type in TypeScript

Partial<T> makes every property of a type optional. Use it to describe update payloads, configuration overrides, and any object where only some fields change.

TypeScript