AngularjsJavascriptTypeScript

How to declares variables in TypeScript?

declares variables in TypeScript

Views

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

Ajay Malhotra
the authorAjay Malhotra
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am full stack developer. I love coding. I know Wordpress, Core php, Angularjs, Angular 2, Angular 6, Angular 7, laravel, Codeigniter, Shopify, Squarespace, Jquery, Google Map Api, Vuejs, Reactjs, Bigcommerce etc.

Leave a Reply

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

Positive SSL