JSFiddle - React, Tailwind, and code Playground

by Ishank Dubey

JavaScript

inherit(new String(""));
function inherit(p){
    if(p==null) throw TypeError();
    var t = typeof p;
    
    if(t != "object" && t!=="function") throw TypeError();
    
    if(Object.create){return Object.create(p);}
    function f(){}    
    f.prototype = p;
    
    return new f();
}