Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


How could you be so wasteful traversing the DOM tree every time to find .main-btn? Shame on you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: