Skip to content

Instantly share code, notes, and snippets.

View jaxkashif34's full-sized avatar
🎃
Full Stack Developer

Kashif Ali jaxkashif34

🎃
Full Stack Developer
View GitHub Profile
@jaxkashif34
jaxkashif34 / Typescript-Types.ts
Last active May 5, 2023 18:27
creating gist so that i can revise later ts concepts
// 1) we can use the same name for interfaces but not for types and class. Additionally interfaces types are merged automatically
// 2) we can use extends keyword to extend other interfaces and also other types (for types we have to use different name keyword ) in case of class we can use extends keyword to extend other classes. we can also extends types from other types
// 3) Syntax: type is defined using the type keyword, followed by a name and a type definition, whereas interface is defined using the interface keyword, followed by a name and a set of properties and methods.
// 4) Extensibility: Interfaces can be extended by other interfaces or classes using the extends keyword, while types cannot be extended.
// 5) Reusability: Types can be used to define unions, intersections, and other advanced types, which can be used in multiple places in your code. Interfaces, on the other hand, can only be used to define object types.
// 6) Aliasing: Types can be used to create aliases for existing types, while inter
my first gist file