其他分享
首页 > 其他分享> > 了不起的typescript

了不起的typescript

作者:互联网

//TypeScript-基本数据类型和报错解析

//基本数据类型
//let num = 25;
/* let flo = 25.5;
let hex = 0xf000;
let binary = 0b1001;
let octal = 0o733; */

//重新赋值
//num = '25';//不能存储非原有数据类型的数据

//ts 原型
//let num:number = 25; //等同于 let num = 25;


//booleab
//let islogin = false;
let islogin:boolean = false;
islogin = true;


//string
let str:string = "hello world";
str = "12";

let anything;//这样做是可以的 等同于 let anything:any
anything = 25;
anything = "hello";

  

标签:25,typescript,anything,了不起,数据类型,islogin,num,let
来源: https://www.cnblogs.com/shaozhu520/p/11438242.html