when we're unable to listen to events on the page but need to run a code immedietaly after an if else condition turns true on the webpage. What can we do to run that bunch of code except setInterval method?
setInterval is okay but it'll run the code in every 1000ms or the ms i put in. But i don't want it to run all the time, just one time when the if/else situation turns true. And without listening to events of course. Is there a better practice than setInterval to do this?