clearTimeout without ID

后端 未结 4 1040
日久生厌
日久生厌 2021-01-14 02:16

Is there any way to clear setTimeout() if it doesn\'t have an explicit ID? The problem is I\'m not allowed to change some code that already ran and set the tim

4条回答
  •  一整个雨季
    2021-01-14 02:36

    No. The clearTimeout method requires that the ID returned from setTimeout be provided in order to remove the timeout.

    Could you post some more information about your scenario? Perhaps some code snippets? There may be a way to work around the scenario.

提交回复
热议问题