00:01 Interfaces have similarities with types but also have their unique features. 00:42 Adding missing properties to an interface in TypeScript 01:22 Passing input parameters in TypeScript using interfaces 01:59 TypeScript interfaces allow for easy code reuse 02:37 In TypeScript, you can use the 'extends' keyword to inherit properties from another class. 03:24 TypeScript interfaces can be extended and inherited 04:01 The difference between Type and Interface in TypeScript 04:39 Interfaces in TypeScript allow for adding new fields, while types cannot be changed after creation. Great lesson sir thanks a lot.
@technicalom93592 жыл бұрын
Very few people but genuine audience. Thank You!!
@AbhishekShandilya-q5c Жыл бұрын
When the compiler encounters multiple interface declarations with the same name, it merges them into a single interface definition that includes all the properties and methods from each declaration. Interface reopening is particularly useful when working with external libraries or modules. It allows you to extend or augment the types provided by those libraries without modifying their original definitions.
@shreyasdongare61522 жыл бұрын
Hitesh i think this the best playlist on typescript on youtube
@ksaha93252 жыл бұрын
From previous video, i was searching for difference between type and interface. And now here it is. ❤️❤️
@vishalthapa31015 ай бұрын
thank you sir, finally i found the exact difference between interface and type
@sundeeep2 жыл бұрын
Keep pushing this content, I am eagerly waiting for the next video.
@HiteshCodeLab2 жыл бұрын
More to come!
@GildwareTechnologies Жыл бұрын
Interface vs. Type in TypeScript TypeScript offers two main ways to define custom data structures: `interface` and `type`. While they share some similarities, they also have distinct characteristics and use cases. **Interfaces:** 1. **Object Shapes:** Interfaces are primarily used to define the shape of an object or the contract that an object must adhere to. They are ideal for defining the structure of objects, especially when modeling classes or instances. ```typescript interface Person { name: string; age: number; } ``` 2. **Class Implementations:** Interfaces can be implemented by classes, ensuring that the class adheres to the structure defined by the interface. ```typescript interface Animal { name: string; speak(): void; } class Dog implements Animal { constructor(public name: string) {} speak() { console.log(`${this.name} barks.`); } } ``` 3. **Extending Interfaces:** You can extend interfaces to create new interfaces that inherit properties and methods from existing ones. ```typescript interface Employee { name: string; } interface Manager extends Employee { department: string; } ``` **Types:** 1. **Unions and Intersections:** Types are more flexible when it comes to creating complex types by combining multiple types using union (`|`) or intersection (`&`) operators. They are useful for creating complex and flexible type compositions. ```typescript type Person = { name: string; age: number }; type Address = { city: string; postalCode: string }; type Contact = Person & Address; ``` 2. **Primitive Types:** Types are often preferred when defining simple types like strings, numbers, booleans, or literal types. ```typescript type Status = "active" | "inactive"; ``` 3. **Mapped Types:** You can create new types based on the properties of existing types using mapped types with types. ```typescript type Optional = { [P in keyof T]?: T[P] }; ``` 4. **Utility Types:** TypeScript provides built-in utility types like `Partial`, `Record`, `Pick`, and `Omit` that work naturally with types. ```typescript type PartialPerson = Partial; type RecordOfPersons = Record; ``` **Scholarship Opportunity:** If you're interested in advancing your skills in TypeScript, JavaScript, or any other programming language, consider exploring our scholarship opportunity at [www.gildware.com/scholarship](www.gildware.com/scholarship). This scholarship is designed to support and empower aspiring programmers and developers on their educational journey. In summary, the choice between `interface` and `type` in TypeScript depends on your specific use case and how you want to model your data and code structure. Both `interface` and `type` have their strengths, and understanding when to use each can help you write more maintainable and expressive TypeScript code.
@Vikas-dm9uc2 жыл бұрын
Beautifully explained, waiting for more videos in this series bhaiya🥰🥰
@HiteshCodeLab2 жыл бұрын
Coming soon
@imamansoni2 жыл бұрын
Now i know what's different in between Interfaces and Type 👍
@HiteshCodeLab2 жыл бұрын
👍
@mdkawsarislamyeasin40402 жыл бұрын
Thanks.. Now all clear 🥰
@TJMcCarty2 жыл бұрын
So interface is sort of like 'let' and type is sort of like 'const', correct? Am I understanding that correctly?
@narendranamdev92592 жыл бұрын
Sir ineuron website pr apke course purchase karne ke liye active coopen. Bta dijiye sir
@akshayramdasi2 жыл бұрын
excellent content in this TS series
@HiteshCodeLab2 жыл бұрын
Thanks
@arunjoshi78852 жыл бұрын
Why no videos are coming @hitesh sir ?
@poojadeshmukh19432 жыл бұрын
Thanks for taking this topic
@SanthoshKumar-fg2zd2 жыл бұрын
Hello sir, can you suggest me a good source to learn sailpoint, by the way video was so understandable as usual
@dcodgaming2 жыл бұрын
Sir ek video banao na ki Bina degree ke software engineer kaise bante hai ? Aur kya badi badi company Leto hai kya software engineer ko Bina degree wale pas uss bande mey sab skills hai