2020年6月26日

04async await

摘要: async async 函数返回值是一个promise对象,promise对象的状态由async函数的返回值决定 //函数的三种定义 async function hello() { return "Hello" }; let hello = async function() { return "H 阅读全文

posted @ 2020-06-26 20:32 章画 阅读(126) 评论(0) 推荐(0) 编辑

09 promise then

摘要: then() 方法返回一个 Promise 链式调用:then里面回调函数(成功回调和失败回调),凡事这两个回调函数里面抛出错误或者返回一个已经是拒绝状态的 Promise。 那么 then 返回的 Promise 对象将是rejected状态,走下一个then里面的失败回调函数 catch() 方 阅读全文

posted @ 2020-06-26 17:30 章画 阅读(127) 评论(0) 推荐(0) 编辑

03回调函数

摘要: //回调函数 doSomeThing(result => { doSomeThingElse(result, newResult => { doSomeThingThird(newResult, finalResult => { console.log(finalResult) }, errCall 阅读全文

posted @ 2020-06-26 15:54 章画 阅读(125) 评论(0) 推荐(0) 编辑

promise 基本流程

摘要: 阅读全文

posted @ 2020-06-26 15:53 章画 阅读(263) 评论(0) 推荐(0) 编辑

promise

摘要: https://blog.csdn.net/qq_34645412/article/details/81170576 https://segmentfault.com/a/1190000007463101#articleHeader2 // 创建一个新的promise对象 const p=new P 阅读全文

posted @ 2020-06-26 14:13 章画 阅读(132) 评论(0) 推荐(0) 编辑

js error 错误处理

摘要: (new) Error([message[, fileName[,lineNumber]]]) 单独定义Error()错误,函数继续进行 当像函数一样使用 Error 时 -- 如果没有 new,它将返回一个 Error 对象。所以, 仅仅调用 Error 产生的结果与通过new 关键字构造 Err 阅读全文

posted @ 2020-06-26 12:25 章画 阅读(1299) 评论(0) 推荐(0) 编辑

导航