Coding task · JavaScript and TypeScript course · Module 6: TypeScript Basics

Practice: Union and Intersection Types

Practice with union and intersection types to describe dinosaurs.

Task

Create a union type DietType = 'herbivore' | 'carnivore' | 'omnivore' and an intersection type AquaticDino = Dinosaur & SwimmingAbility.