1let fruits: Array<string>;
2fruits = ['Apple', 'Orange', 'Banana'];
3
4let ids: Array<number>;
5ids = [23, 34, 100, 124, 44];
1// let arr_name, elemType[];
2let list: number[] = [1, 2, 3];
3// Generic array type, Array<elemType>:
4let list: Array<number> = [1, 2, 3];
1const animals = ['cat', 'dog', 'mouse'] as const
2type Animal = typeof animals[number]
3
4// type Animal = 'cat' | 'dog' | 'mouse'