To test that ElectricCar really inherits from Car, we want to know if every ElectricCar object is also a Car object. We'll use the instanceof keyword to test if our myElectricCar object (created using the ElectricCar constructor) is an instance of Car. This will mean myElectricCar inherits data and methods from the Car class.

We've used the instanceof keyword to see if myElectricCar is an instance of the Car class. Running the code should print out true if ElectricCar is an instance of Car.