All in title,
e.g.
users: User[];
users: array<User>;
What is the difference? Is there one a better practice than the other?
nb: I couldn't find information about this & I see both in source code.
All in title,
e.g.
users: User[];
users: array<User>;
What is the difference? Is there one a better practice than the other?
nb: I couldn't find information about this & I see both in source code.
users: User[];
is a valid type.
users: array<User>;
is not a valid type. You will get an error Cannot find name 'array'
.
You can create your interface like below.
export interface Person {
users: User[];
}
export interface User {
firstName: string;
lastName: string;
}