JSFiddle - React, Tailwind, and code Playground
JavaScript
// This is essentially what happens when you do:
// y = new Foo();
var Foo = function() {};
var y = {};
y.__proto__ = Foo.prototype;
//y.constructor = Foo;
alert(y.constructor === Foo); // true
alert(y instanceof Foo); // true