'use strict' function extend(sub, sup) { var F = function(); F.prototype = sup.prototype; sub.prototype = new F(); sub.prototype.constructor = sub; sub.supclass = sup.prototype; if (sup.prototype.constructor == Object.prototype.constructor) { sup.prototype.constructor = sup; } } var F = function () { }; F.prototype = { }; console.log(new F());