了不起的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";

  

上一篇:人物专访 | 杜军:处在新基建时代,坚定做数字经济大厦奠基人


下一篇:react-7 条件渲染与列表渲染