Data Types in TypeScript

preview_player
Показать описание
Contact For Technical Discussion : (WhatsApp ) 9492506121.

Required technologies to explain the example
1) TypeScript,
2) Visual Studio 2022,
3) .Net Framework 4.8,
4) ASP.NET MVC

Data Types in TypeScript

//##################Code Start ##################
function welcome() {
//boolean - true or false
//number - numbers and floating point values
//string - text, group of characters.
//any - boolean / number / string.

//Explicit Type - Primitive Types
let Name: string = "Mohan Rao";
let Age: number = 72;
let IsAgeAbove_18: boolean = true;
let Address: string = "Gachibowli,\
Hyderabad,\
India,\
Pin Code : 500001\
";

let salary: any = 40000;
salary = "40k";
salary = true;

alert(
"Name = " + Name + ",\n" +
"Age = " + Age + ",\n" +
"Is Age Above 18 = " + IsAgeAbove_18 + ",\n" +
"Address = " + Address + ""
);

//Explicit Type - Arryas
let AccountsTeams: string[] = ["Ravi", "Raju", "Kiran"];

let AccountsTeamsIDs: number[] = [1, 2, 3];

//Implicit Type - Primitive Types
let Father_Name = "Marella Pavan";
let Father_Age = 82;
let Father_IsAgeAbove_18 = true;
let Father_Address = "Gachibowli\n\
Hyderabad\n\
India\n\
Pin Code : 500001\n\
";
alert(
"Father Name = " + Father_Name + ",\n" +
"Father Age = " + Father_Age + ",\n" +
"Father Is Age Above 18 = " + Father_IsAgeAbove_18 + ",\n" +
"Father Address = " + Father_Address + ""
);

}
welcome();
//##################Code End##################

Supported Browsers to debug for TypeScript/JavaScript.
Рекомендации по теме
join shbcf.ru