microsoft / TypeScript-Website

The Website and web infrastructure for learning TypeScript
https://www.typescriptlang.org
Creative Commons Attribution 4.0 International
2.21k stars 1.36k forks source link

Docs: type assertion example missing angle brackets "<type>" #452

Closed rajinder-yadav closed 4 years ago

rajinder-yadav commented 4 years ago

Page URL:

https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions

Issue:

let strLength: number = (someValue).length;

should ne

let strLength: number = (<string>someValue).length;

Recommended Fix:

Browser:

orta commented 4 years ago

Looks like this is a twoslash bug - #405 should fix it

orta commented 4 years ago

Confirmed 405 - didn't fix it - it's being interpreted as a html element