JS 手写promise 实现
摘要:function MyPromise (execute) { // value 记录异步任务成功的执行结果 this.value = null; // reason 记录异步任务失败的执行结果 this.reason = null; // status 记录当前状态,初始化pending this.
阅读全文
Jquery --- map循环
摘要:结果: [24, -6, 2, 0, -18] element: 就相当于原生的 元素, 如果要想作为Jq 对象去用的话,需要这样 $(element);
阅读全文