You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function New(obj, ...arr) {
len ans = {};
ans.__proto__ = obj.prototype; // 连接原型对象
// Object.setPrototypeOf(ans, obj.prototype)
// let ans = Object.create(obj.prototype);
let result = obj.apply(ans, arr); //获得构造函数的返回值
return ans === Object ? ans : result;
// 判断构造函数的返回值是否与创造的实例不同
}
The text was updated successfully, but these errors were encountered: