From the course: TypeScript: Object-Oriented Programming
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Inheritance
From the course: TypeScript: Object-Oriented Programming
Challenge: Inheritance
(upbeat music) - [Instructor] Welcome to challenge two, inheritance. This is going to be based off of our challenge one. And we're going to build upon that except now we're going to use the user class below. Hopefully it looks somewhat familiar and we're going to create an admin class that simply extends user and a guest class that implements user. Typical for your standard application that has authentication. You're going to have some sort of user roles, and that's what we're going to do. We want to practice a little bit of how one matching a shape and another actually being a child differs. Now, we also want to make sure that we use constructors that don't let those values just be inherited upwards. So make sure you use the first name, last name and email in your constructor. When you go and implement and extend, just so that you can get a little bit of practice remembering which one does what. Let's go ahead and get…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Inheritance introduction1m 54s
-
(Locked)
Extending classes in TypeScript2m 40s
-
(Locked)
Implementing classes in TypeScript1m 22s
-
(Locked)
Super()3m 43s
-
(Locked)
Super() overrides1m 56s
-
(Locked)
Generics2m 46s
-
(Locked)
Polymorphism3m 8s
-
(Locked)
Challenge: Inheritance59s
-
(Locked)
Solution: Inheritance3m 10s
-
-
-