JSFiddle - React, Tailwind, and code Playground

by chrisramakers

JavaScript

function ClassA(value){
    this.name = "ClassA";
    this.type = 'a class';
    this.value = value;
    this.getValue = function(){
        return this.value;
    }
    this.getName = function(){
        return this.name;
    }
}

function ClassB(value){
    ClassA.call(this, value);
    
    this.name = "ClassB";
}

var a = new ClassA(10);
var b = new ClassB(20);

//document.write(a.getName(), '<hr>');
//document.write(b.getName(), '<hr>');

//document.write(a.getValue(), '<hr>');
//document.write(b.getValue(), '<hr>');