JSFiddle - React, Tailwind, and code Playground
JavaScript
class Parent {
hi () {
console.log('hi');
}
}
class Child extends Parent {
constructor () {
this.hi = function () {
super.hi();
console.log('child hi');
}
}
}
const obj = new Child();
obj.hi();