How to declare a Fixed length Array in TypeScript
The JavaScript array has a constructor that accepts the length of the array: let arr = new Array<number>(3); console.log(arr); // [undefined × 3] However, this is just the initial size, there’s no restriction on changing that: arr.push(5); console.log(arr); // [undefined × 3, 5] TypeScript has tuple types which let you define an array with a … Read more