Code Snippet:
interface Human {
name: string;
age: number;
}
interface Pet {
name: string;
type: string;
}
If I have an array of Human
, how can I get an array of Pet's
type
.
For instance:
Is there a built-in way to achieve this in typescript?