1
2
3
4
5
6
7
function _new(fn){
let obj = Object.create(fn.prototype);
let arg = [].slice.call(arguments,1);
let res = fn.apply(obj,arg);
return res instanceOf Object ? res : obj;
}