Przemek Franczak
TypeScriptReactjavascriptSystem designInterview questions
The difference between ?? and || in TypeScript

April 1, 2025 - 2 minutes

The difference between ?? and || in TypeScript

Since both operators can be used to achieve similar results, sometimes people confuse them and don't know the difference or when to use one. Let's dive into the topic and settle it once for all.

Learn more
Union, intersection types in TypeScript. What they are and when to use them.

April 10, 2025 - 3 minutes

Union, intersection types in TypeScript. What they are and when to use them.

TypeScript provides two incredibly powerful tools for building expressive type systems: unions and intersections. They’re often misunderstood or seen as “advanced,” but once you get the hang of them, they’re essential for modeling real-world data structures cleanly and safely. Let’s explore how they work, when to use them, and how to level up your type game with more advanced patterns like discriminated unions and type narrowing.

Learn more
satisfies vs Type Annotation in TypeScript – What's the Difference?

April 29, 2025 - 2 minutes

satisfies vs Type Annotation in TypeScript – What's the Difference?

TypeScript gives you two main ways to validate that a value conforms to a type: the classic type annotation (:), and the newer satisfies operator introduced in TypeScript 4.9. They look similar, but behave very differently — and using the right one can help you write more precise, safer, and more expressive code. Let’s break down what they do, how they differ, and when to use which.

Learn more