“as” 运算符是类型声明
接下来举个例子来看一下:
let aaa= '123';
let bbb= <number>aaa;
let aaa= '123';
let bbb= aaa as number;
这两段代码做的完全相同
接下来举个例子来看一下:
let aaa= '123';
let bbb= <number>aaa;
let aaa= '123';
let bbb= aaa as number;
这两段代码做的完全相同