#what does `string & {}` type exactly mean?
5 messages · Page 1 of 1 (latest)
@livid elm Usually that's used to prevent string unions from collapsing to string to give better intellisense
Preview:```ts
type Collapses = "foo" | "bar" | string
// ^?
const x: Collapses = "" // no intellisense here
type DoesntCollapse = "foo" | "bar" | (string & {})
// ^?
const y: DoesntCollapse = ""```
You can choose specific lines to embed by selecting them before copying the link.
ooh i see! that's great to know. thanks a lot 