October 2017
Intermediate to advanced
280 pages
6h 50m
English
Interfaces may also extend each other. For example, we may turn our Individual class into an interface that has a social security number:
interface Accountable {
accountNumber: string;
getIncome(): number;
}
interface Individual extends Accountable {
ssn: string;
}
Since interfaces support multiple inheritances, Individual may also extend the Human interface that has the name and age properties:
interface Accountable {
accountNumber: string;
getIncome(): number;
}
interface Human {
age: number;
name: number;
}
interface Individual extends Accountable, Human {
ssn: string;
}
Read now
Unlock full access