一、概览: async:函数 await:操作符
await必须在async函数中才能使用 await后面可以是任意值,但是一般跟Promise对象 1、Promise的resolve方法的值就是await值 2、Promise的reject不会作为值返回,需要使用try-catch捕获
xxxpjgl 博主文章分类:javascript ©著作权
文章标签 async;awai 文章分类 JavaScript 前端开发
一、概览: async:函数 await:操作符
await必须在async函数中才能使用 await后面可以是任意值,但是一般跟Promise对象 1、Promise的resolve方法的值就是await值 2、Promise的reject不会作为值返回,需要使用try-catch捕获
下一篇:五华参谋逻辑
Artemis高级用法
异步注解@Async自定义线程池
的高级用法,开发者可以在JavaScript中以更加声明式和直观的方式处理复杂的异步逻辑,同时保持代码整洁和可维护性。后者不仅让异步代码更加简洁,而
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M