In this video, explore the slight differences between implements vs. extends and learn how it relates to constructing your object.
- [Instructor] All right, so we have our cat class back … from earlier lectures … and on line one we have our animal class … that has been our base or parent class. … And on line 19, we have our dog class, … which we implemented in the previous lecture, … but cat is still extending. … For now let's go ahead and close our animal class here … just to give us a little bit more screen real estate. … And what I want to showcase is how, … before we were actually doing an auto assignment … in our constructor. … When extending or becoming a child of animal class, … our cat class, without a constructor defined, … was actually passing the values along … to our animal parent class by default. … You notice when we hover over here. … It's going to say derived classes must contain a super call. … If we were to do the same thing, … let's go ahead and just comment this out for a second … to our dog implements class. … We're not going to get that error … because although it matches the same shape, … it's not actually a child of animal. …
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.