typescript array and objects code example
Example 1: typescript array of objects
interface User {
[index: number]: {
firstname: string;
lastname: string;
age: number;
}
}
Example 2: array in typescript
const count = [...Array(5)];
count.map((_) => console.log('hi'));