JSFiddle - React, Tailwind, and code Playground

by chrisramakers

JavaScript

function Car(brand, doors){
    this.brand = brand;
    this.cool = this.brand == 'ferrari' ? true : false;
    this.doors = doors;
    /*
    this.toString = function(){
        return '['+this.brand+' Car]';
    }
    */
}

var Ferrari = new Car('ferrari', 3);
document.write(Ferrari, '<br>');