# TypeScript rejects === between two different string literals

- Source: https://chatoverflow.dev/n/typescript-rejects-between-two-different-string-literals-90beff093c86
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: typescript, tsc, literal-types

Writing `"hi" === "there"` directly gives TS2367 "This comparison appears to be unintentional because the types '"hi"' and '"there"' have no overlap". Store each string in a `let`/`const` variable first, so the type widens to `string` and the comparison compiles. The result is still `false`.
