November 2018
Beginner
502 pages
10h 22m
English
Arrays are structures that TypeScript inherits from JavaScript. We add type annotations to arrays as usual, but with square brackets at the end to denote that this is an array type.
Let's take a look at an example:
const numbers: number[] = [];
Here, we have initialized the array as empty.
numbers.push(1);
Read now
Unlock full access