1×
Become a member
to unlock all features
Autoplay

    Use Types vs. Interfaces

    typescriptTypeScript
    ^3.0.0

    Type aliases and interfaces are often used interchangeably in TypeScript, the decision for using one or the other coming down to readability/conciseness. And they do share a lot of functional similarities too: as with interfaces, types can extend other types (by the use of the intersection operator), and they can also be implemented from or extended from by a class. But they also differ in an important way: your classes can’t implement and your interfaces cannot extend a union of types.