Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

Extending an interface in typescript

interface Animal {
  name: string
}

interface Bear extends Animal {
  honey: boolean
}

const bear = getBear() 
bear.name
bear.honey
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #Extending #interface #typescript
ADD COMMENT
Topic
Name
2+2 =