---
title: "Anmol Kansal (@kansalanmol0609) | Hashnode"
description: "Full Stack Developer. Read the latest articles by Anmol Kansal on Hashnode."
url: "https://hashnode.com/@kansalanmol0609"
---

@kansalanmol0609

# Anmol Kansal

@kansalanmol0609 · Gurgaon, India · Joined April 2022

Full Stack Developer

[Website](https://www.anmolkansal.in/)

### [Implement ReturnType<T> Utility Type from Scratch in TypeScript](https://anmol-kansal.hashnode.dev/implement-returntype-t-utility-type-from-scratch-in-typescript-07ca7e790c0d?utm_source=hashnode&utm_medium=feed)

Hey there, TypeScript tinkerers! 👋 Ever thought about how doesReturnType<T> works under the hood? Today we’re going to build our own version of ReturnType<T> from the ground up, so you can see how it works under the hood. Let’s dive in! Why do I nee...

2 min read · [anmol-kansal.hashnode.dev](https://anmol-kansal.hashnode.dev/implement-returntype-t-utility-type-from-scratch-in-typescript-07ca7e790c0d?utm_source=hashnode&utm_medium=feed)

[Jun 17, 2025](https://hashnode.com/posts/implement-returntype-t-utility-type-from-scratch-in-typescript-07ca7e790c0d/6851b0f6bcad5a8cfa0994bb)

### [Why TypeScript Fails to Infer Types in Your Switch Statements](https://anmol-kansal.hashnode.dev/why-typescript-fails-to-infer-types-in-your-switch-statements-95c2c515ff1e?utm_source=hashnode&utm_medium=feed)

TypeScript’s type inference system is incredibly powerful — but it also has strict rules designed to keep your code predictable and safe. Sometimes, those rules can feel overly cautious. A common example? Using a switch statement with discriminated u...

3 min read · [anmol-kansal.hashnode.dev](https://anmol-kansal.hashnode.dev/why-typescript-fails-to-infer-types-in-your-switch-statements-95c2c515ff1e?utm_source=hashnode&utm_medium=feed)

[Apr 18, 2025](https://hashnode.com/posts/why-typescript-fails-to-infer-types-in-your-switch-statements-95c2c515ff1e/6851b0fa6fd83aa331a89410)

### [🔄 Global State in React Without Context API or External Libraries](https://anmol-kansal.hashnode.dev/global-state-in-react-without-context-api-or-external-libraries?utm_source=hashnode&utm_medium=feed)

Managing the global state is a common challenge in React. While tools like Redux, Zustand, or even React’s built-in Context API are popular choices, they can sometimes feel like overkill for simpler use cases. What if you could share the state betwee...

2 min read · [anmol-kansal.hashnode.dev](https://anmol-kansal.hashnode.dev/global-state-in-react-without-context-api-or-external-libraries?utm_source=hashnode&utm_medium=feed)

[Apr 5, 2025](https://hashnode.com/posts/global-state-in-react-without-context-api-or-external-libraries/67f16aa383aba99b00d16b2e)

### [Implementing a Polyfill for Promise.allSettled() in JavaScript](https://anmol-kansal.hashnode.dev/implementing-a-polyfill-for-promiseallsettled-in-javascript?utm_source=hashnode&utm_medium=feed)

In this post, you will learn how to implement a polyfill for Promise.allSettled() from scratch

3 min read · [anmol-kansal.hashnode.dev](https://anmol-kansal.hashnode.dev/implementing-a-polyfill-for-promiseallsettled-in-javascript?utm_source=hashnode&utm_medium=feed)

[Mar 28, 2025](https://hashnode.com/posts/implementing-a-polyfill-for-promiseallsettled-in-javascript/67ec0a58ae4692f774542326)

### [🚀 Implementing a Polyfill for Promise.all in JavaScript](https://anmol-kansal.hashnode.dev/implementing-a-polyfill-for-promiseall-in-javascript?utm_source=hashnode&utm_medium=feed)

In this post, you will learn how to implement a polyfill for Promise.all in JavaScript

2 min read · [anmol-kansal.hashnode.dev](https://anmol-kansal.hashnode.dev/implementing-a-polyfill-for-promiseall-in-javascript?utm_source=hashnode&utm_medium=feed)

[Mar 15, 2025](https://hashnode.com/posts/implementing-a-polyfill-for-promiseall-in-javascript/67d564ce8d0fb7fad8c13b13)
