noUncheckedIndexedAccess

The compiler option that adds undefined to the type of every array index or dictionary lookup, because the entry might not exist.

In more detail

With it, names[0] on a string array has type string | undefined, so you must check before using it. It pairs with index signatures, where any key may be missing. It is not part of strict and must be turned on separately.

Related terms

Taught in

References