【文件属性】:
文件名称:weekly:每周发行并分享
文件大小:8.78MB
文件格式:ZIP
更新时间:2021-04-28 00:15:26
HTML
weekly
issue and share weekly
讨论 issue
写到 issue 里面,一直open就好,各抒己见。
例如:
new操作符都做了什么?
function new(func) {
let target = {};
target.__proto__ = func.prototype;
let res = func.call(target);
// null 也是 object
if (typeof(res) == "object" || typeof(res) == "function" || res !== null) {
return res;
}
return target;
}
四大步骤:
创建一个空对象,并且 this 变量引用该对象,// let target = {};
继承了函数的原型。// target.proto = f