- Any datatype says TypeScript to ignore type check on the variable.
- This means that you can store string, boolean and number in the variable.
- Any can mostly be used in migration project.
var a : any; a = 10; a = true; a = "Hello World"
- Union Type can be used to define multiple data type to a variable.
- This is achieved by using pipe separated data type.
- Below is the example for the same.
var a : number | boolean; a = 10; a = true;