【发布时间】:2022-11-04 21:48:15
【问题描述】:
我需要编写一个 javascript for 循环,其中将执行相同的函数,但 i++ 只能在循环中的函数结束时发生
例子 :
function test($parameter) {};
for (let index = 0; index < array.length; index++) {
test(array[index]; // but need to wait to function ended
}
请问有可能吗?
多谢
【问题讨论】:
-
除非
test是异步的。
标签: javascript