TypeScript - Basics
To start with TypeScript, you must know the basic types available specifically for JavaScript. Every more complex structure will be built composed of the basic types.
These foundations will enable you to create more complex, real-life types.
Basic data types
I know that in TypeScript, you can use basic types such as number, string, boolean, null, and undefined
I am aware that in JavaScript, there is no distinction between integers and floating-point numbers
Value as type
I know that I can use a value (e.g., string or number) to create a specific type
Union types
I know I can use the |
symbol to create union types that will accept one of the allowed types as the value of the variable.
Arrays
I know that I can create a type that accepts an array of elements of a specific type using the ...[]
or Array<...>
syntax
Tuples
I know that I can create tuples and I know how they are different from array types
I know that in TypeScript, you can use basic types such as number, string, boolean, null, and undefined
I am aware that in JavaScript, there is no distinction between integers and floating-point numbers
I know that I can use a value (e.g., string or number) to create a specific type
I know I can use the |
symbol to create union types that will accept one of the allowed types as the value of the variable.
I know that I can create a type that accepts an array of elements of a specific type using the ...[]
or Array<...>
syntax
I know that I can create tuples and I know how they are different from array types