摘要: 1:catch方法 具体看代码 1 const promise = new Promise((resolve, reject) => { 2 // resolve() 3 // reject('rejected meaasge') 第一种写法 4 //第二种写法 抛出异常 5 throw new E 阅读全文
posted @ 2022-03-31 19:59 沁霓 阅读(365) 评论(0) 推荐(0)
摘要: then 方法 then是对象上面的一个方法。它其实是放在 Promise.prototype.then 1:同一个Promise可以调用多次then方法 2:then方法传入的回调函数可以有返回值,返回值是一个新的Promise,具体返回的类型类似于resolve参数 返回值是一个新的Promis 阅读全文
posted @ 2022-03-31 11:54 沁霓 阅读(1957) 评论(0) 推荐(0)