TypeScript's `never` Type: The Most Misunderstood Keyword in the Language
You're writing TypeScript, everything's going fine, and then you see it: Type 'string' is not assignable to type 'never'. Your first reaction is probably "what the hell is never?" You didn't write ...

Source: DEV Community
You're writing TypeScript, everything's going fine, and then you see it: Type 'string' is not assignable to type 'never'. Your first reaction is probably "what the hell is never?" You didn't write it. You didn't ask for it. And the error message isn't helping. Most people Google it, find a one-liner explanation ("a type that represents values that never occur"), nod slowly, and move on without actually understanding it. I know because that's exactly what I did. But never is one of those things that clicks once you see why it exists, and then you start using it on purpose. The Opposite of any Here's the mental model. TypeScript has two extremes: any: "this could be literally anything, I don't care" never: "this can literally never happen" any is the top. Everything is assignable to it. never is the bottom. Nothing is assignable to it (except another never). They're opposites. let anything: any = "hello"; // ✅ fine anything = 42; // ✅ fine anything = true; // ✅ fine let nothing: never =