typescript-tutorial
typescript-tutorial copied to clipboard
任意属性那个章节运行的效果和教程不同
https://ts.xcatliu.com/basics/type-of-object-interfaces.html interface Person { name: string; age?: number; }
let tom: Person = { name: 'Tom', age: 25, gender: 'male' }; 我运行了不报错。 ts 编译器版本:Version 4.5.5