Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Clarify "Extending interfaces" #149

Closed
dirkpostma opened this issue Feb 13, 2016 · 1 comment
Closed

Clarify "Extending interfaces" #149

dirkpostma opened this issue Feb 13, 2016 · 1 comment

Comments

@dirkpostma
Copy link

In https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Interfaces.md#extending-interfaces

The following syntax is used:

let square = <Square>{};

This is the first time the < > notation is used. I don't know what this is yet, so I don't have a usggestion to improve, except for saying: this should either be explained, or the example should be rewritten without this syntax.

@DanielRosenwasser
Copy link
Member

That's a type assertion. It's a way of telling TypeScript that you should treat the {} as having the Square type. It's basically casting to another type with no runtime impact.

Also, duplicate of #123

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants