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
1 Answer
+ 4
Use setTimeout function:
var t;
setTimeout(function() {
t = setInterval(move, 100);
},3000);
Notice how I passed an anonymous function directly as callback.