Typescript, Typescript With React, Programming, JavaScript, Technology.
case "rectangle": return shape.width * shape.height; } } Here, the kind property serves as a discriminant, allowing TypeScript to understand and narrow down the type within the switch statement. Ensuring Exhaustiveness: TypeScript ensures exhaustiveness by prompting developers to handle all