How to use clearInterval and setInterval in 2 buttons
I want to make a timer with a start and stop button but putting setInterval in a different onclick function puts it out of the scope of the clearInterval onclick function. Help? https://code.sololearn.com/WOFp8gzRooBE/?ref=app
You were declaring variable go in only start function so it was out of scope for other functions. Also set setInterval for 10ms (100 in it) , its good for visualization. Hope this helps ☺️☺️.
If this helps https://code.sololearn.com/WIlyIcwF0810/?ref=app
Yes it did, thanks Meet Mehta