Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

extending a type in typescript

type Animal = {
  name: string
}
type Bear = Animal & { 
  honey: Boolean 
}
const bear = getBear();
bear.name;
bear.honey;
        
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #extending #type #typescript
ADD COMMENT
Topic
Name
6+6 =