JSFiddle - React, Tailwind, and code Playground
JavaScript
// sub Object1
function name(){
this.name = function(){
var myName = 'FirstName';
console.log(myName, this.last.last);
}
this.callName = function(){
this.name();
};
}
// sub Object2
function lastName(){
this.lastName ='someLastName';
}
// super Object
function fullName(){
// DoesNothing
}
fullName.prototype.name = new name();
fullName.prototype.last = new lastName();
var myName = new fullName();
myName.name.callName();