JSFiddle - React, Tailwind, and code Playground

by sc0rp10

JavaScript

/* спиздил у Кантора */
function extend(Child, Parent) {
    var F = function() { }
    F.prototype = Parent.prototype
    Child.prototype = new F()
    Child.prototype.constructor = Child
    Child.superclass = Parent.prototype
}

function Animal() {
        this.handleException = function(e) {
            alert(e.stack)
        }
}
        
function Rabbit()  {
        this.gav = function(){
            throw new Error("ya krolik bleat!");
        }
}

extend(Rabbit, Animal)
var r = new Rabbit()
alert(r.gav())