Join Eve Porcello for an in-depth discussion in this video Class inheritance, part of Up and Running with ECMAScript 6.
- Now that I've created our Vehicle class,…I want to create a new class…that will inherit from the Vehicle class.…This is a process called extending the class.…We'll use the same file from the last lesson…and we're going to add onto it…with a pretty similar syntax.…The first thing that I'll do here is I will use class…SemiTruck extends vehicle.…This will make sure that the new SemiTruck…has the same properties as the vehicle,…description and wheels.…
Inside of our SemiTruck class,…we want to use constructor to create it.…Then inside of the constructor method,…we're going to use super.…So, super is going to refer back to the vehicle class…and then we can set up the properties.…So, for description, I'll create SemiTruck…and then for wheels, we'll use 18.…The next thing that we want to do here on line 26,…is we want to create a new instance of the SemiTruck.…
So, we'll say groceryStoreSemi…= new SemiTruck.…So, again, same exact syntax that we used…up there on line 16.…The next thing that we'll do is we'll use…groceryStoreSemi…
- What is ECMAScript?
- Transpiling ECMAScript with Babel and Babel-node
- Using the let and const keywords
- Creating strings with template strings
- Enhancing object literals
- Working with ES6 classes and class inheritance
Skill Level Beginner
Learn React.js: The Basics (2015)with Eve Porcello1h 32m Beginner
Up and Running with AngularJS 1with Ray Villalobos1h 20m Intermediate
Building a Polling App with Socket IO and React.jswith Alex Banks3h 56m Intermediate
1. What Is ECMAScript 6 (ES6)?
2. Transpiling ES6
3. ES6 Syntax
4. ES6 Functions & Objects
5. ES6 Classes
- 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.