Re:Stimulation Clicker
by hombre_fatal on Monday January 06, 2025 @01:54PM
(#42613942)
If you're already using setTimeout, why not just use it directly?
[ Parent
| on HN ]
What's all this overengineering and waste creating timeouts?
Why not just use setInterval?
let interval = setInterval(() => document.querySelector('.main-btn').click(), 50)
Then clearInterval(interval)
to stop
Re:Stimulation Clicker
by hombre_fatal on Monday January 06, 2025 @06:13PM
(#42617198)
How could you be so wasteful traversing the DOM tree every time to find .main-btn? Shame on you.
That's an infinite loop.