摘要: <ul id="list"></ul> const ul = document.getElementById('list') const fragment = document.createDocumentFragment() for (let i = 0; i < 5; i++) { const 阅读全文
posted @ 2021-08-22 23:04 吴小明- 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 一、async函数返回值都是Promise对象 二、promise.then 成功的情况 对应await 三、promise.catch 失败的情况 对应try…catch 一、async函数返回值都是Promise对象 1、返回值不是promise对象,那么新promise的状态为fullfill 阅读全文
posted @ 2021-08-22 20:19 吴小明- 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 结论: 1、then 正常返回时,Promise的状态为fulfilled 报错时,Promise的状态为rejected 2、catch 正常返回时,Promise的状态为fullfilled 报错时,Promise的状态为rejected 当状态为成功时: const p = Promise.r 阅读全文
posted @ 2021-08-22 18:16 吴小明- 阅读(544) 评论(0) 推荐(0) 编辑
摘要: <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script> <script> const ID_BASE_URL = 'https://jsonplaceholder.typicode.com/to 阅读全文
posted @ 2021-08-22 16:58 吴小明- 阅读(53) 评论(0) 推荐(0) 编辑