JSFiddle - React, Tailwind, and code Playground

by alexflav23

JavaScript

function ErrorChild(name, message) {
    Error.call(this);
    this.name = name;
    this.message = message;
}

Object.create(ErrorChild.prototype, Error.prototype);
var myerror = new ErrorChild("test", "Help!");
document.body.innerHTML += myerror.message;