SOURCE

function newMethods(fn, ...args) {
    const obj = {}
    obj.__proto__ = fn.prototype
    fn.apply(obj, args)
    return obj
}
function Person(a) {
    this.a = a
}
const kk = newMethods(Person, 89)
console.log(kk)
console 命令行工具 X clear

                    
>
console