Before we go on, let's see what basic types are supported by TypeScript:
- boolean: true or false.
- number: Floating point values. Those can be expressed in hexadecimal, decimal, binary, and octal forms.
- string: can be delimited by single quotes ('), double quotes ("), or back-ticks (`) to define template literals (also known as template strings).
Here are some examples of numbers:
- let decimal: number = 42
- let hexadecimal: number = 0x42
- let binary: number = 0b101010
- let octal: number = 0o52
Here are some string examples:
- let hello: string = 'Hello'
- let world: string = "World" // same as above
- let cool: string = `${hello} ${world}!`
Template strings are very useful—they make it really easy to embed expressions. In ...