Skip to content
Justice Tech School

Useful Strict Flags

noImplicitAny, strictNullChecks, noUncheckedIndexedAccess and exactOptionalPropertyTypes catch more bugs.

Example
const arr: number[] = [1];
const x = arr[5];
console.log(x === undefined);

Result

true

Exercise

Check unsafe index.

noUncheckedAccess

Quiz Test

Which flag makes arr[i] possibly undefined?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.