June 2021
Intermediate to advanced
398 pages
9h 35m
English
At its most basic, TypeScript allows you to annotate any variable declaration with a type by using the syntax : <type>, as in let x: number. As we’ll see, this can get more complicated, but the starting point is annotating variables with types.
TypeScript defines four basic types:
boolean: A Boolean value must be either JavaScript’s true or false value.
number: JavaScript only has one numeric type for floating point numbers. TypeScript’s number type supports floating point and integer literals, hex literals (0xab32), octal literals (0o1234), and binary literals (0b10010).
string: TypeScript allows both single and double quotes as string delimiters and supports the backquote (\) syntax for template strings. ...