+ 2
How to make a delay before running a function in JavaScript
Pls answer
3 Answers
+ 4
setTimeout(func, 3000);
func will be called a bit later than 3 seconds (3000 milliseconds).
Notice that I did not put parantheses: func not func()
+ 3
Use 'setTimeout(function, delay)' function.
Example (sorry if too complicated):
https://code.sololearn.com/WijhEK1U6Bpb/?ref=app
(this "no connection" bug...)
+ 1
Ore Thank you, it works!