© 2026 Hashnode
Union number adalah fitur di TypeScript yang memungkinkan Anda mendefinisikan sebuah tipe sebagai kumpulan nilai numerik tertentu. Misalnya, Anda mungkin memiliki sebuah tipe yang hanya menerima angka tertentu, seperti 1 | 2 | 3. Namun, ketika meneri...

This blog post will show the difference between these two operators. In TypeScript, operators are essential tools that allow us to manipulate data and control the flow of applications. Among the various operators, the pipe symbol (|) and the double p...

You might have heard of "Enums with superpowers", "Tagged Union Types" or Algebraic Data Types(ADT). It is heavily used in functional programming. And yet, you rarely see them in enterprise codebases. Why is that? A common use case for ADTs is to rep...

This is a handy Typescript trick! In simple terms, I like to describe this feature as conditional types. This feature allows you to do things like the below ApiResponse type, let the code talk for himself // You can assert the property will have a sp...
