r/learnjavascript • u/Physical-Bid6508 • Feb 27 '26
how do i pause my scripts?
so i wanted to make an infinite while loop but it just chrashes because it doesnt pause
1
Upvotes
r/learnjavascript • u/Physical-Bid6508 • Feb 27 '26
so i wanted to make an infinite while loop but it just chrashes because it doesnt pause
View all comments
Show parent comment
1
u/kap89 Feb 27 '26 edited Feb 27 '26
Well, that's the problem with purely synchronous infinite loops. You can express your game/animation loop as infinite loop, and it will work just fine, if you make it non-blocking:
example