Anmol Kansal

Anmol Kansal

  • Home
  • About

Tag

#typescript

Cover Image for Implement ReturnType<T> Utility Type from Scratch in TypeScript

Implement ReturnType<T> Utility Type from Scratch in TypeScript

Hey there, TypeScript tinkerers! 👋 Ever thought about how doesReturnType<T> works under the hood? Today we’re going to build our own versio…

Jun 17, 2025
Cover Image for Why TypeScript Fails to Infer Types in Your Switch Statements

Why TypeScript Fails to Infer Types in Your Switch Statements

TypeScript’s type inference system is incredibly powerful — but it also has strict rules designed to keep your code predictable and safe. So…

Apr 18, 2025
Cover Image for Difference between an undefined value and a missing property in TypeScript

Difference between an undefined value and a missing property in TypeScript

There is one serious issue with the default behavior of the typescript compiler w.r.t optional types. To properly understand the difference …

Jan 30, 2023
Cover Image for When to use Type Only Imports Exports in TypeScript?

When to use Type Only Imports Exports in TypeScript?

Since the introduction of type-only imports in TypeScript 3.8, a lot of developers including me have been confused about the usage of type-o…

Jan 22, 2023
Anmol Kansal

Anmol Kansal

Web Development allows me to bring my ideas to life.

Subscribe to my newsletter to stay up to date with articles!