主页
TypeScript
TypeScript 简单类型
demo_simple_types_explicit
运行 ❯
×
更改方向
保存代码
更改主题
let firstName: string = "Dylan"; // type string firstName = 33; // attempts to re-assign the value to a different type console.log(firstName);
prog.ts(2,1): 错误 TS2322:类型“number”不可分配给类型“string”。