Challenge: ES6 Inheritance

This challenge will test your skills in implementing inheritance and constructors in ES6 version of JavaScript.

Problem statement

In this challenge, there are two classes, Vehicle and Car. You need to implement inheritance between them so that Car is the child class and Vehicle is the parent. You have the following tasks:

  • Define a constructor for Vehicle that initializes a fuel (given in ml) property.

  • Define the turnOn and turnOff functions in Vehicle. ...