I recently dived into the world of TypeScript by picking up a book titled Typescript Revealed (Published in February 2013). Chapter 2 caught my attention with a section on "Casts" featuring an intriguing example:
var a : int = <int>SomeNumberAsAString;
Excited to try it out, I attempted the following implementation:
var SomeNumberAsAString = "1000";
var a: int = <int>SomeNumberAsAString;
However, much to my dismay, the compiler threw an error:
hello.ts(2,8): error TS2304: Cannot find name 'int'.
hello.ts(2,15): error TS2304: Cannot find name 'int'.
This left me contemplating how to execute this cast correctly, or if there have been updates to the TypeScript specifications.