Null & Undefined
Null and undefined are primitive types (set tsconfig.json - “strictNullChecks”: true; disabled by default)
Optional
Section titled “Optional”Optional chaining with ?. allows us to access properties on an object that may be null or undefined
Nullish Coalescence
Section titled “Nullish Coalescence”Writing expressions that have a fallback value when null or undefined is encountered
Null Assertion
Section titled “Null Assertion”The ! tells TypeScript “trust me, this isn’t null/undefined”:
Use sparingly - if you’re wrong, you’ll get a runtime error.
Array Bounds Handling
Section titled “Array Bounds Handling”TypeScript assumes array access never returns null or undefined (unless undefined is part of the array type).