Did you know about Discriminated Unions in TypeScript?
Dec 30, 2023 · 5 min read · Instead of diving straight into the theory, let us take a look at a practical example: Requirements: You need to create a function that returns one of the 3 shapes, namely Square, Rectangle, and Circle. The function should accept only the relevant ...
Join discussion