TypeScript

Null Vs Undefined in TypeScript

TypeScript has two special values for Null and Undefined. Both represent no value or absence of any value. The difference between Null & Undefined is subtle and confusing. Prior to TypeScript 2.0, we could assign them all other types like numbers, strings, etc. Such assignment has been the source of a lot of errors likeTypeErrors or ReferenceErrors in JavaScript. The StrictNullChecks introduced in version 2.0 raises compile-time errors if we use Null or Undefined. In this tutorial, we compare Null and Undefined. let us learn the similarities and differences etc.

Null Vs Undefined in TypeScript Read More »

Null in TypeScript

The null in TypeScript is a special value & also a data type. The value null represents the intentional absence of any object value. It is one of TypeScript’s primitive values and is treated as falsy for boolean operations. The value of null is represented in using the literal null.

Null in TypeScript Read More »

Undefined in TypeScript

Undefined is a special value and also a data type in TypeScript. TypeScript also has a global variable with the name undefined which has the value Undefined. Undefined is a primitive values and is treated as falsy for boolean operations. In this tutorial let us learn how to use undefined in TypeScript.

Undefined in TypeScript Read More »

Scroll to Top