JSFiddle - React, Tailwind, and code Playground
JavaScript
class A {
// name = 'Batman';
constructor () {
this.name = 'Batman';
}
getName () {
return this.name;
}
}
class B extends A {
constructor (name) {
super();
this.name = name;
}
}
const bObj = new B('Petya');
console.log(bObj.getName());