What is Type Compatibility in TypeScript?
TypeScript has a structural type system, which means that types are compatible based on their shape or structure rather than their names. This allows you to interchangeably use types with different names but identical properties. You can assign one type to another if they share the same properties, including optional properties.