How to manage a timer in Javascript?

0 like 0 dislike
3 views
Starting the timer in one function, how to disable it in another function?
by | 3 views

1 Answer

0 like 0 dislike
var timer = setTimeout(Action, 5000); function Action(){ //your actions //disable the timer if (timer) { clearTimeout(timer) } }
by

Related questions

0 like 0 dislike
6 answers
0 like 0 dislike
2 answers
asked Aug 13, 2019 by gsv_rus
0 like 0 dislike
3 answers
asked Aug 1, 2019 by DennisKingsman
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
33,905 users