JSFiddle - React, Tailwind, and code Playground

by Richard Hunter

JavaScript

function inherit(C, P) {
	var F = function () {}
  F.prototype = P.prototype;
  C.prototype = new F();
  C.uber = P.prototype;
  C.prototype.constructor = C;
}

function PromiseType() {}


function MyPromise() {}

inherit(MyPromise, PromiseType);

var foo = new MyPromise();

console.log(foo instanceof PromiseType);