JSFiddle - React, Tailwind, and code Playground
by MartijnR
JavaScript
function FormHTML() {
this.branch = new this.Branch(this);
this.branch.dobranch();
};
FormHTML.prototype.input = {
doinput: function() {
console.log('doing input (tried to reach this code from branch property');
}
};
FormHTML.prototype.Branch = function(parent) {
this.dobranch = function() {
console.log('doing branch');
parent.input.doinput();
}
};
form = new FormHTML();