[removed] Is it ok to call cleartimeout before settimeout?

前端 未结 5 1468
滥情空心
滥情空心 2021-02-18 19:05

I have a function that sets a timer, and calls itself back upon expiration of the timer.

What I\'d like to know is if it is bad practice to clear the timer at the top o

5条回答
  •  既然无缘
    2021-02-18 20:13

    Clearing a Timeout raises not problem to me (but i am not a javascript guru).

    Btw, you can find intersting things (checking an existing Timeout) on this thread: Check if a timeout has been cleared?

提交回复
热议问题