Working with Variables, Enums and Arrays with Typescript
In our last post we discussed an introduction and installation of Typescript, in this post we will discuss how to work with Variables, Enums and Arrays with Typescript.
Working with Variables
There are different types available in Typescript which are almost available in JS like
Number
String
Boolean
Any
void
Null
Variable Declaration
Declarations of variable can be done with following in Typescript
let
const
var
Working with Arrays and Enums
Enums allow us to define a set of named numeric constants. An enum can be defined using the enum keyword.
Arrays
Inserting an value in to an array can be done something like this
Here is the complete source code of the above discussion in GitHub
Here is the complete video of the above discussion
VariablesArrays and Enums
Thanks for reading the post and watching the video!!!
Please leave your comments and let me know if there is anything I should update in this post.
Thanks,
Karthik KK