Prevent the browser from freezing when using setTimeout

Here is the pen

How can I prevent the browser from freezing when looping with setTimeout()?
Maybe limit the times it loops?

Solved it. The callback inside the setTimeout shouldn’t have parentheses. I got the solution from here.

1 Like

Glad you solved it and thanks for posting the answer - it may help others in future.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.