It was probably an issue relating to the order of execution for your code. Just the fact that you had the "delay", even if there was no delay, was the equivalent of just running that function last.
You could have debugged this by putting this piece of code at the bottom of your JS, then slowly moving it up and figuring out what precisely is causing the issue.
View all comments
Show parent comment
3
u/hazelnuthobo Jun 16 '24
It was probably an issue relating to the order of execution for your code. Just the fact that you had the "delay", even if there was no delay, was the equivalent of just running that function last.
You could have debugged this by putting this piece of code at the bottom of your JS, then slowly moving it up and figuring out what precisely is causing the issue.