How to wait in javascript?

Publicado em: 01 Janeiro 1970
no 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


Nesta página do site você pode assistir ao vídeo on-line How to wait in javascript? duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário GamerMan 01 Janeiro 1970, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 54 vezes e gostou 1 espectadores. Boa visualização!