Pause setInterval | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Pause setInterval

Please How to pause setInterval please help me with the code https://code.sololearn.com/W3g8KxEp7tV3/?ref=app

24th Oct 2020, 6:19 PM
Ibrahim Yusuf
Ibrahim Yusuf - avatar
3 Respostas
+ 2
Ibrahim Yusuf You'll have to store the interval timestamp in a variable and use it to clear the interval. Then when play() is clicked you should create a new interval. var interval = setInterval (time,200); clearInterval(interval);
24th Oct 2020, 6:56 PM
Kevin ā˜…
+ 4
Kevin ā˜… thanks, let me work on that
24th Oct 2020, 7:03 PM
Ibrahim Yusuf
Ibrahim Yusuf - avatar
+ 4
Kevin ā˜… Thank you, I've gotten it. check out the code https://code.sololearn.com/W3g8KxEp7tV3/?ref=app
24th Oct 2020, 7:24 PM
Ibrahim Yusuf
Ibrahim Yusuf - avatar