Generics give your TypeScript classes a way to work with multiple types and not just one.
- [Instructor] Generics are a very powerful tool … to give static typing to a dynamic type. … And oftentimes you'll see so many people use, … or just any to do that, … and it causes a lot of problem. … any should be avoided at all costs, … and sometimes generic can solve that. … One common thing that I've had to do … at a couple places when using generics, … and I haven't had to use them too many times, … is when merging different data sets … that we haven't been able … to do data migration on for instance, … and that's an example we're going to look at. … So, there is going to be a little bit more setup in this … than perhaps in other videos. … Now, you'll see on line one, we have a User class, … and then we have this classicUserData property, … and this params of any. … Now, it'd be nice if we could actually … define what this type is and make it generic, … because we don't know … if it's going to be ClassicUser, or ClassicUser2, … and you might do that, but it might be something else, …
Skill Level Intermediate
TypeScript: Upgrades and Featureswith Emmanuel Henri1h 15m Advanced
TypeScript for Node.js Developerswith Emmanuel Henri1h 2m Intermediate
1. Classes in TypeScript
2. Inheritance in TypeScript
3. Access Modifiers in TypeScript
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.