Types
Main Primitives
Section titled “Main Primitives”- Boolean
- Number
- String
Explicit
Section titled “Explicit”Implicit
Section titled “Implicit”In some cases, type can be inferred from the value.
Disables type checking. Unsafe.
Unknown
Section titled “Unknown”Safer than any. You can assign anything to it, but you must narrow the type before using it.
Forces an error.
Null & Undefined
Section titled “Null & Undefined”Primitives in JS, but also types in TS.
strictNullChecks must be enabled in tsconfig.json