How do you wait time in JS. | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

How do you wait time in JS.

For the loading animation, I need to wait time and then move. How do you wait time in JS. https://code.sololearn.com/WKxWvfqDV41C/?ref=app

16th Jun 2020, 10:21 PM
SweepSweep2
SweepSweep2 - avatar
1 Respuesta
+ 4
Use setTimeout function: var t; setTimeout(function() { t = setInterval(move, 100); },3000); Notice how I passed an anonymous function directly as callback.
16th Jun 2020, 10:35 PM
Kevin ★