Typescript variables

From wikinotes

NOTE:

see also javascript variables

Assignment

let name: string = "alex";   // type annotation
let name = "alex";           // inferred type 'string'
let foo = bar.baz() as User; // type assertion (I know this is a user, but compiler won't)