How to wait in javascript?

Publicado el: 01 enero 1970
en el canal de: GamerMan
54
1

I this video i show you how to make a wait function(because there is no built in one).

Code:

async function waitUntil(conditionFunction, interval = 100) {
while (!conditionFunction()) {
await new Promise(resolve = /**add an angled bracket here**\ setTimeout(resolve, interval));
}
}

async function wait(time) {
await new Promise(resolve = /**add an angled bracket here**\ setTimeout(resolve, time*1000));
}

Chapters:

0:00 - 0:49 - Intro
0:50 - 1:37 - Wait Until
1:38 - 2:07 - Wait
2:08 - 2:24 - Outro


En esta página del sitio puede ver el video en línea How to wait in javascript? de Duración hora minuto segunda en buena calidad , que subió el usuario GamerMan 01 enero 1970, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 54 veces y le gustó 1 a los espectadores. Disfruta viendo!