Skip to content

任意属性那个章节运行的效果和教程不同 #219

Description

@suzhenghui-sky

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions