How do you wait time in JS. | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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 Réponse
+ 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 ★