A variable is declared as string | number and currently narrowed to string. Why may a lat…

from Type narrowing
TypeScript 6 intermediate 3 min

A variable is declared as string | number and currently narrowed to string. Why may a later assignment of 42 still compile?

Report an error