1.手写new操作符
//注意: 1. Fn可传参数 2.Fn是否为函数 3.Fn内部是否有返回值,返回值是否是obj
function myNew(Fn){
if(typeof Fn !=='function') throw new TypeError('this is not a constructor');
const args = Array.from(arguments).slice(1);
const obj = {};
obj.__proto__= Fn.prototype;
const res = Fn.call(obj,...args);
return Object(res)===res?res:obj;
}