Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite+ 6
How to set an Interval/Timeout in Javascript without calling any function?
I found two lessons in JS where you call functions and the time. And somehow worked, but is there a way to set an Interval or Timeout without calling a function? Like in python, time.sleep() exists, how do I do it?
1 Réponse
0
It is usually avoided in javascript to do things like `Time.sleep` because this would block the main thread (blocking the main thread means no javascript can run at that time so those menu /sidebar will not open or close on button clicks) but you can get Time.sleep like thing from external library.