Home Angularjs How to declares variables in TypeScript?

How to declares variables in TypeScript?

by therichpost
Published: Updated: 0 comments

Hello, welcome to therichpost.com. In this post, I will tell you How to declares variables in TypeScript? I recently started learning Angularjs 2 but I familiar with Angularjs 1 but in Angularjs 2 came with new feature called TypeScript. TypeScript coding structure similar with oops. C# and Java developers can easily learn TypeScript.

Today we will How to declares variables in TypeScript? . here you can check the code:

1. String variables :

var name:string = “therichposrt”;

2. Number variables :

var num:number = 20;

3. Any variables :

var numstr:any = “str20”;

4. Boolean variables :

var isval:boolean = true”;

5. Array variables :

var list:number[] = [1, 2, 3];

var name:string[] = [“rich”, “post”];

There are many more TypeScript and i will let you know all. Please do comment if you any query related to this post. Thank you. Therichpost.com

You may also like

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.