JSFiddle - React, Tailwind, and code Playground

JavaScript

function A() {

};

A.prototype.doSomething = function() {
console.log("hi")


}

A.prototype.doSomethingElse = function() {}

function B() { };

function C() { };

B.prototype = Object.create(A.prototype);
C.prototype = Object.create(A.prototype);

B.prototype.doSomething = function() {
       console.log("goodbye");
    }

var b = new B();
var c = new C();

b.doSomething();
c.doSomething();