TypeScript Advanced Types

Nullable Types / Non Nullable Types in TypeScript

Typescript types are Nullable Types. i.e you can assign Null & undefined to any of the types. The compiler will not throw any error. But from the Typescript version 2.0, we can define Non Nullable types with the –strictNullChecks flag on. The strictNullChecks is flag is set to false by default. But, when set to true in tsconfig.json it stops us from assigning the null & undefined to a type. Thus converting the types into Non Nullable types.

Nullable Types / Non Nullable Types in TypeScript Read More »

Scroll to Top