JSFiddle - React, Tailwind, and code Playground

by silv3r_m00n

JavaScript

function A()
{
}

A.prototype.sound = function()
{
  document.write('Inside A');
}

function B()
{
}

B.prototype = new A();

//Fix the constructor of B
B.prototype.constructor = B;

if(B.prototype.__proto__ == A.prototype)
{
  document.write('HOW DID YOU DO THIS');
}

var b = new B;
b.sound();