extending a type in typescript

Solutions on MaxInterview for extending a type in typescript by the best coders in the world

showing results for - "extending a type in typescript"
Mark
23 Jan 2019
1type Animal = {
2  name: string
3}
4type Bear = Animal & { 
5  honey: Boolean 
6}
7const bear = getBear();
8bear.name;
9bear.honey;
10