JSFiddle - React, Tailwind, and code Playground

JavaScript

// sub Object1
    function name(){
        this.name = function(){
            var myName = 'FirstName';
            console.log(myName, this.last.lastName);
        }
        
        this.callName = function(){
            this.name();
        };
    }
    
    // sub Object2
    function lastName(){
        this.lastName ='someLastName';
    }
    
    // super Object
    function fullName(){
        // DoesNothing
    }
    
    name.prototype.last  = new lastName();
    fullName.prototype.name  = new name();
    
    var myName = new fullName();
    myName.name.callName();