July 2018
Intermediate to advanced
420 pages
8h 46m
English
In TypeScript, undefined and null are types themselves; this means that undefined is a type (undefined) and null is a type (null). Confusing? undefined and null cannot be type variables; they can only be assigned as values to variables.
They are also different: a null variable means that a variable was set to null, while an undefined variable has no value assigned.
let A = null; console.log(A) // null console.log(B) // undefined
Read now
Unlock full access