JSFiddle - React, Tailwind, and code Playground
JavaScript
function Base() {
}
Base.prototype.init = function() {
console.log(this);
}
Base.prototype.save = function() {
console.log('save');
}
function Map() {
}
extend(Map, Base);
Map.init = function() {
//some code
Map.prototype.init();
}
Map.save = function() {
console.log('Map save');
}
function extend(Child, Parent) {
var F = function() { }
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constructor = Child;
Child.superclass = Parent.prototype;
}
Map.init()