JSFiddle - React, Tailwind, and code Playground

by tara5

JavaScript

function A () {
    this.someproperty = 's';
}

A.prototype.ab = function () {
    // does something
}

A.prototype.cd = function () {
    // does something
}

function B () {
    A.call(this);

    this.someOtherProperty = 'b';
}

B.prototype = A.prototype;
B.prototype.constructor = B;

function C () {
    B.call(this);
}

C.prototype = B.prototype;
C.prototype.constructor = C;

C.prototype.ef = function () {
    // does something
}

function D () {
    C.call(this);

    this.someOtherProperty = 'd';
}

D.prototype = C.prototype;
D.prototype.constructor = D;

let variable = new D();

variable.ab()
variable.cd()
variable.ef()