Learn the more advanced features of classes like extension and inheritance. Eve demonstrates how to create a new class that inherits from and extends another class. She also shows how to adjust the properties of the parent class. The use of classes in ES6 is similar to classes in Java and Python.
- [Tutor] In the previous video, we created a Vehicle class, … and now I'm going to create a new class that will inherit … from the Vehicle class. … And this is a process called extending the class, … which means that I can take a vehicle … which could be any kind of vehicle, … a car, a truck, a bicycle, … and extend it to customize it … for a specific type of vehicle. … So the type I'm going to create is a SemiTruck. … Now inside of the constructor, … we're going to pass in a couple of values … for description and wheels, … and we're going to pass these via a function called super. … So super is going to go up to the Vehicle … and it's going to plug in SemiTruck for the descriptor … and 18 for the number of wheels. … When I want to create a new instance of the SemiTruck, … I'll do it here on line 20, … I'll just create a variable and I'll set it equal … to a new SemiTruck. … And now I can use the describeYourself function … to actually log that message. … So this is class inheritance. …
This course was created by Eve Porcello. We are pleased to offer this training in our library.
- What is ECMAScript?
- Writing and searching strings
- Writing maps
- Destructuring arrays
- Searching arrays
- Creating objects
- Destructuring objects
- Iterating with the for/of loop
- Getting and setting class values
- Using ECMAScript functions
- Building and returning promises
- Using async/await syntax
Skill Level Intermediate
1. What Is ECMAScript?
What is ECMAScript?1m 44s
2. ECMAScript Variables and Data Structures
3. Arrays and Array Methods
Destructuring arrays1m 34s
4. ECMAScript Objects
5. ECMAScript Functions
- 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.