JSFiddle - React, Tailwind, and code Playground

JavaScript

function car(make,model){
    console.log( 'car constructor' );
    this.setMake( make );
    this.setModel( model );
}
car.prototype.setColor = function(color){ this.color = color; };
car.prototype.setMake  = function(make ){ this.make  = make;  };
car.prototype.setModel = function(model){ this.model = model; };
car.prototype.toString = function(){ return 'This is a ' + this.color + ' ' + this.make + ' ' + this.model + ' car' };

function volvo( model ){
    console.log( 'volvo constructor' );
    car.call( this, 'volvo', model );
}
volvo.prototype = Object.create( car.prototype );
volvo.prototype.constructor = volvo;

var c = new car('Ford', 'Fiesta');
c.setColor('Red');
console.log( c.toString() );

var v = new volvo( 'S10' );
v.setColor( 'Grey' );
console.log( v.toString() );