In the previous article we’ve already seen What is TypeScript, How to get Started with TypeScript. In this post we will be seeing Data Types in TypeScript.
Data is important, yes it is, If anything which has highest importance in this Software Industry is data. We just cannot store random data anywhere, we need specific type of containers to store the data in order to prevent the mess. If I have 60 candies of 6 types, I would definitely be putting 10 candies each inside 6 different jars based on the type of candies so that they don’t get mixed up. Similarly like any other programming language TypeScript too has Data Types.
In TypeScript Majorly Data Types are Built in Data Types, User-Defined Data Types and Any data type.
Built in Data Types:
Any Data Type: This is Dynamic data types, if some variable is declared with any data-type then any type of value can be assigned to that variable.
User Defined Data Types:
User can also defined their own data types, User-defined types include Enumerations i.e. enums, classes, interfaces, arrays, and tuple.
One thought on “Data Types in TypeScript”