JSFiddle - React, Tailwind, and code Playground

by ariehg

JavaScript

function A(){
    this.log();
};

A.prototype.log = function(){console.log('A');};

function B(){
    this.parents = {
        A: A.prototype
    };
    
    A.apply(this,arguments);  
};

B.prototype.log = function(){
    this.parents.A.log.apply(this);
    
    console.log('B');
};

new B