JSFiddle - React, Tailwind, and code Playground

by godgav

HTML

<div id="result"></div>

JavaScript

var vehicle = function(){
    this.speed = 0;
    this.color = 'black';
    this.setSpeed = function(val) {
        this.speed = val;
    }
}

var car = function(engineType){
   
    this.getEngine = function(){
        return engine;
    }
}

car.prototype = new vehicle();

car.prototype.speed = 7;

var ford = new car('v12');

var ford1 = new car('v12');

alert(ford.speed);
alert(ford1.speed);