0Pricing
TypeScript Academy · Lesson

null, undefined, and Strict Null Checks

Handle null and undefined safely with strict mode.

Welcome

In JavaScript, null and undefined are common sources of runtime errors. TypeScript's strict null checks force you to handle them explicitly.

null vs undefined

`undefined` means a variable has been declared but not assigned. `null` is an intentional absence of value. Both are separate types in TypeScript.
let a: undefined = undefined;
let b: null = null;

All lessons in this course

  1. Primitive Types: string, number, boolean
  2. The any Type and Why to Avoid It
  3. unknown vs any: The Safer Choice
  4. null, undefined, and Strict Null Checks
← Back to TypeScript Academy