synchronous and asynchronous loops in javascript

后端 未结 5 1333
我在风中等你
我在风中等你 2020-12-14 06:43

Are loops synchronous or asynchronous in JavaScript? (for, while, etc)

Supposing I have:

for(let i=0; i<10; i++){
    // A (nested stuff...)
}

//         


        
5条回答
  •  余生分开走
    2020-12-14 07:02

    for(const elment of arrayElements) {
                await yourFunc(elment)
                await yourOtherFunc('somePatameter')
    }
    

提交回复
热议问题