O'Reilly logo

Learning Angular for .NET Developers by Rajesh Gunasundaram

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Any

The Any data type is a dynamic data type that can hold Any value. TypeScript throws compile time errors if you assign a string-type variable to an integer-type variable. If you are unsure about what value a variable will hold, and you would like to opt out of compiler checking for the type in the assignment, you can use the Any data type:

let mixedList:any[] = [1, "I am string", false]; mixedList [2] = "no you are not"; 

Here, we used an array of the any type so that it can hold any type, such as number, string, and boolean.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required