window.news = function(){
const [instance, ...arg] = arguments;
let _o = Object.create(instance.prototype);
let result = instance.apply(_o, arg);
return typeof result === 'object' ? result : _o;
}
function Test(name){
this.name = name;
}
Test.prototype.getName = function(){
console.log(this.name)
}
let o = news(Test,'张三')
console.log(o)
o.getName()