Skip to content

Instantly share code, notes, and snippets.

@aneurysmjs
Created October 15, 2019 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aneurysmjs/034cbdc97d0e902e7f637bf2a6ee114e to your computer and use it in GitHub Desktop.
Save aneurysmjs/034cbdc97d0e902e7f637bf2a6ee114e to your computer and use it in GitHub Desktop.
types vs interfaces
interface Base {
id: string;
timestamp: string;
}
interface Product extends Base {
price: number;
stock: number;
}
// type aliases can't be extended but can be interfered
type Product {
price: number;
stock: number;
} & Base;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment