function newFactory(){
var obj = new Object();
var args = arguments;
fn = args.shift();
obj.__proto__ = fn.prototype;
var result = fn.call(obj,args);
return typeof result === 'object' ? result : obj;
}
new模拟实现
最新推荐文章于 2023-07-31 20:18:55 发布