Created
April 4, 2022 10:59
-
-
Save ZacharyL2/dcc88006792bf0c66b0b998d69fdc9bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// ✨ In intersection types, all types will absorb `unknown`. | |
type T1 = unknown & null; // null | |
type T2 = unknown & number; // number | |
type T3 = unknown & never; // never | |
type T4 = unknown & unknown; // unknown | |
type T5<T> = T & unknown; // T | |
type T6 = unknown & any; // any | |
// never (`null & undefined` will become never) | |
type T7 = unknown & null & undefined; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment