SOURCE

function _new(constructor, ...params){
    let o = Object.create(constructor.prototype);
    let res = constructor.apply(o, params);
    return res===null?o:res;
}

function Person(name, age){
    this.name = name;
    this.age = age;
    this.sayName = function() {
        console.log('TheNameIs' + this.name);
    }
    return this;
}

let P1 = new Person('kk', '26');
let P2 = _new(Person, 'karo', '23');
P1.sayName();
P2.sayName();
let P3 = _new(Object.__proto__);
console.log(P3);
console 命令行工具 X clear

                    
>
console