当前位置:网站首页>js promise. all
js promise. all
2022-07-02 10:40:00 【Big chicken legs are best】
let d= promise.all([a,b,c])
Accept one promise Array , Only those in the array promise Success returns only after all success , Or fail
Only a、b、c The state of fulfilled,d The state of fulfilled, here a、b、c The return value of consists of an array , Pass to d Callback function for .
as long as a、b、c One of them was rejected,d The state of rejected, At this time, the first was reject The return value of the instance of , Will pass to p Callback function for .
Interview questions
function c In function a and b Only after the execution
Just use promise.all
let a=function(){
console.log('a')
}
let b=function(){
console.log('b')
}
let p1 = new Promise((resolve, reject) => {
a()
resolve(' succeed ')
})
let p2 = new Promise((resolve, reject) => {
b()
resolve('success')
})
let c=function(){
console.log('c')
}
Promise.all([p1, p2]).then((result) => {
c()
})
边栏推荐
- 【虚幻4】从U3D到UE4的转型之路
- Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
- 2021-10-04
- 使用Windbg静态分析dump文件(实战经验总结)
- flume 190 INSTALL
- Flutter环境配置保姆级教程,让doctor一绿到底
- Retrofit's callback hell is really vulnerable in kotlin synergy mode!
- [IDL] Research
- "Talking about podcasts" vol.352 the age of children: breaking the inner scroll, what can we do before high school?
- MYSQL关键字
猜你喜欢

虚幻材质编辑器基础——如何连接一个最基本的材质

Test -- Summary of interview questions

Rapid prototyping

Basic notes of illusory AI blueprint (10000 words)

【Unity3D】嵌套使用Layout Group制作拥有动态子物体高度的Scroll View

pytest--之测试报告allure配置

STM32 and motor development (upper system)

Post disaster reconstruction -- Floyd thought

12.进程同步与信号量

MYSQL环境配置
随机推荐
SAP Spartacus express checkout design
SUS系统可用性量表
Mock Server基本使用方法
《MySQL 8 DBA基础教程》简介
Test -- Summary of interview questions
AttributeError: type object ‘Image‘ has no attribute ‘fromarray‘
ERROR 1118 (42000): Row size too large (> 8126)
Zlib download and use
pytest学习--base
Postman--使用
"Talking about podcasts" vol.352 the age of children: breaking the inner scroll, what can we do before high school?
js setTimeout()与面试题
Blender模型导入ue、碰撞设置
AutoCAD - layer Linetype
[unity3d] nested use layout group to make scroll view with dynamic sub object height
【Visual Studio】每次打开一个Unity3D的脚本,都会自动重新打开一个新的VS2017
【Unity3D】制作进度条——让Image同时具有Filled和Sliced的功能
Application of rxjs operator withlatestfrom in Spartacus UI of SAP e-commerce cloud
This article takes you to learn in detail what is fiber to home FTTH
"Matching" is true love, a new attitude for young people to make friends