Skip to content

Mention structural typing in Quick Start #11954

@Arnoku

Description

@Arnoku

TypeScript Version: 2.0.3 / nightly (2.1.0-dev.201xxxxx)

Code

// A self-contained demonstration of the problem follows...
In your Quick start documentation (https://www.typescriptlang.org/docs/tutorial.html), could you please fix or make more clear on the bottom of the page in the Classes section that Interface and Class in the example ARE NOT RELATED, and that the nature of TypeScript is that it can be even an empty object without instantiating any class at all like so:

greeter({ firstname: "John", lastname: "White" });

Since coming from a partially OOP background, it confused me a lot how come we instantiate a Student class object, but the function expets a Person interface object, and there is no connection between them except for same property names. Cheers

Expected behavior:

Actual behavior:

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsThe issue relates to how you learn TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions