In this video, learn about overriding methods and how super() is more than just passing data to your base class.
- [Instructor] You may have been wondering earlier … if the super keyword that we use … to pass the data from our child constructor … to our parent constructor … is just one and done, … and we're not ever going to really reference it again. … But we are. … And it's one of the items that distinguishes … extends from implements more than anything else. … You see here in our cat class on line 19, … we have our meow method. … Let's go ahead and actually just add a copy of this … to our parent class like so, … and we'll just do a generic one … instead of meow hiss hiss, … we'll do roar, roar, roar, … something a little bit more generic. … The meow name may not be that generic, … but that's not what this is about right now. … What we've essentially done … is we have overwritten our animals meow with our cat meow. … Now the super keyword here … actually allows us to access methods from our parent class. … Now, when overwriting methods, … there's always a reference to the overwritten method. …
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.