Arrays in TypeScript are a special type of object that can store multiple values of the same data type. Unlike JavaScript, TypeScript allows you to explicitly specify the type of elements that an array can hold. This ensures type safety and helps prevent accidental errors during development.

Let's explore both in depth.
[].


<type> Notation.const numbers: Array<number> = [4, 5, 6, 8];
const chaiFlavours: Array<string> = ["chai", "masala chai", "kadak chai"];
const isLoggedIn: Array<boolean> = [true, false, true];
const mixedValues: Array<number | string> = [1, "two", 3, "four"];
A multidimensional array is an array that contains other arrays as its elements. In simpler terms, it's an array of arrays.
You can think of it like a grid or a table useful for representing rows and columns, such as a matrix.
In TypeScript, multidimensional arrays are defined using the same square bracket notation as one-dimensional arrays, but with nested square brackets to indicate additional dimensions.
const chaiAurMatrix: number[][] = [
[1, 2],
[3, 4],
];
const OneD: number[] = [1, 2, 3, 4, 5];
const twoD: number[][] = [[1, 2, 3, 4, 5]];
const threeD: number[][][] = [[[1, 2, 3, 4, 5]]];
console.log(OneD);
console.log(twoD);
console.log(threeD);