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