This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my first gist file |