How to clear all setInterval() and setTimeOut() without knowing their ID?

前端 未结 3 701
北恋
北恋 2021-01-16 15:10

If I don\'t know the return value of setInterval() or setTimeOut(), can I still use clearInterveral(id) or clearTimeOut(id)

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-16 15:59

    As far as I know, this is not possible without the original id, so storing that, maybe in an array would be a good idea

提交回复
热议问题