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

Challenge: Inheritance

From the course: TypeScript: Object-Oriented Programming

Start my 1-month free trial

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…

Contents