Skip to content

Instantly share code, notes, and snippets.

@ZacharyL2
Created April 4, 2022 10:59
Show Gist options
  • Save ZacharyL2/0a7bc4f8b0ea988e2a440cbdb7a93e79 to your computer and use it in GitHub Desktop.
Save ZacharyL2/0a7bc4f8b0ea988e2a440cbdb7a93e79 to your computer and use it in GitHub Desktop.
{
// ✨ In union types, `unknown` absorbs all other types except `any`.
type T1 = unknown | null; // unknown
type T2 = unknown | number; // unknown
type T3 = unknown | never; // unknown
type T4 = unknown | unknown; // unknown
type T5<T> = T | unknown; // unknown
// ❗
type T6 = unknown | any; // any
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment