+ 1
How can I stop a function and start another From the other?
I have a function than print A every second then i want than that function stop it and start another that print B. Do you can understant me? https://code.sololearn.com/WYypuFNoL01M/?ref=app
8 Respuestas
+ 6
Hint: try to print func_A.t1 before apply clearInterval on it and see what its...
+ 3
Propy Grammar Moruzian I know what you want do but mine was an hint for make you think about the problem of your code... Run this
https://code.sololearn.com/WAL6sCsI6j96/?ref=app and see what is printed on console when the callbacks are called...
+ 2
Just now i seen 👍
+ 1
Yes, but what I try to do is stop the print function by using the method (function b)
+ 1
Thanks for your answer :)
+ 1
What I want is that when "B" starts printing, "A" stops printing
+ 1
Propy Grammar Moruzian setInterval return the id (an integer) for stop the inteval right? If it return good but when you try to "access" to it outside its undefined (have you runned my code?) , it mean than you access to it in bad way then you really dont stop the interval...
+ 1
I could solve it, thank you very much for everything, good luck