摘要:
深拷贝一般用JSON.parse(JSON.stringify(object))就可以解决了, 也知道这种方法的局限性: 会忽略 undefined 不能序列化函数 不能解决循环引用的对象 因为MessageChannel的postMessage传递的数据也是深拷贝的,这和web worker的po 阅读全文
摘要:
ES5写法 function Promise (executor) { this.PromiseState = 'pending'; // Promise状态 只有 pending fulfilled rejected 三种 this.PromiseResult = null; // 传递结果 th 阅读全文