diff --git a/README.md b/README.md index 599a6cd..8cbba80 100644 --- a/README.md +++ b/README.md @@ -971,7 +971,17 @@ function travelToTexas(vehicle: Bicycle | Car) { **Good:** ```ts -type Vehicle = Bicycle | Car; +interface Vehicle { + move(current: Location, destination: Location): void +} + +class Bicycle implements Vehicle { + // ... +} + +class Car implements Vehicle { + // ... +} function travelToTexas(vehicle: Vehicle) { vehicle.move(currentLocation, new Location('texas'));