0
[SOLVED] How to cancel previous setTimeout when new setTimeout is call
I want to cancel previous setTimeout function in myFunction when myFunction run for second times https://code.sololearn.com/WZ10v4LHvdrj/?ref=app
4 Réponses
+ 2
use clearTimeout() 👇👇👇
https://code.sololearn.com/WUu3LQThxTA4/?ref=app
+ 2
Thanks man for helping, even though your solution is not the exactly what i want, but it's give me the idea how to solved the problem.
Here's is the code that working like i wanted to:
https://code.sololearn.com/WTn183cIwDJp/?ref=app
+ 1
EsaKurniawan
your welcome, i thought i understood your question well🤔👍
+ 1
the question is little bit unclear though, what i really mean is that, when myFunction has been run and that function run again and then clear the previous setTimeout