#What does [K in T & string]?
9 messages · Page 1 of 1 (latest)
It's just X & string.
type X = 'foo' | 'bar' | 42 | symbol | true
type Result = X & string
// ^? - type Result = "foo" | "bar"
& intersects two types and returns the common.
I see, so it filters out what is not string
TS type system is modeled after set theory, & is just like intersecting two sets.