Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在执行下一步操作之前是否需要清除 setInterval() 和 setTimeout() 方法。因为在使用 setInterval 和 timeout 做了一些动画之后,我正在绘制形状但它不起作用......所以请帮助我......
在 setTimeout 之后,您不需要清除 Timeout。
clearTimeout 用于取消尚未发生的 setTimout 或使用 clearInterval 停止 setInterval。
已执行的 setTimeout 已完成。
为了获得更好的答案,您需要提供更多代码作为示例。