JSFiddle - React, Tailwind, and code Playground
HTML
<div id='log'>Log:<br></div>
JavaScript
//Father.js
var Father = function () {
var init = function () {
document.getElementById("log").innerHTML += '<br>father w/o ptototype';
}
};
Father.prototype.init = function() {
document.getElementById("log").innerHTML += '<br>father overloaded by prototype';
};
//Child.js
var Child = function () {
}
Child.prototype.init = function(){
document.getElementById("log").innerHTML += '<br>child';
}
var myfather = new Father();
myfather.init();
var myChild = new Child();
myChild.init();