November 2018
Beginner
502 pages
10h 22m
English
Interfaces can extend other interfaces so that they inherit all the properties and methods from its parent. We do this using the extends keyword after the new interface name and before the interface name that is being extended.
Let's look at the following example:
interface Product { name: string; unitPrice: number;}interface DiscountCode { code: string; percentage: number;}interface ProductWithDiscountCodes extends Product { discountCodes: DiscountCode[];}
const table: ProductWithDiscountCodes ...
Read now
Unlock full access