JSFiddle - React, Tailwind, and code Playground

JavaScript

function level(config) {
    if(config){
   this.someProperty = config.prop;
   alert("Level constructor");
   alert("Level property " + this.someProperty);
    }
}

function level1(config) {
   level.call(this, config);
   this.someProperty2 = config.prop2;
   alert("Level1 Construtor");
   alert("Leve1 property " + this.someProperty2);
   alert("Level1 using prop from level " + this.someProperty);
}

level1.prototype = new level();

var myLevel = new level1({
    prop: "Test prop",
    prop2: "Test prop2"
});