function mynew (fn, args) { let obj = Object.create(fn.prototype) let result = fn.apply(obj, args) return result instanceof Object ? result : obj }