December 2017
Beginner
372 pages
10h 32m
English
The any keyword is a special type in TypeScript that allows us to opt out of type checking for that variable. This type is very useful when we are migrating the old JavaScript code to TypeScript. We can have the variables defined as any, and TypeScript will not perform any type checking on those. The following example shows the use of the any type:
let item: any;item = 10;item = 'John';item = [10,20,30];
In the preceding code, the compiler does not complain when we assign a number, string, or array to the same variable.
Read now
Unlock full access