2nd Jul 2018, 8:33 PM
Sina
Sina - avatar
3 Answers
+ 1
The *break* keyword is used to stop a loop (for, while, ...). In your case you are setting an interval - not a loop. To stop an interval first you have to assign the interval to a variable: var interval = setInterval(a, 40); Only then you can stop that interval with: clearInterval(interval);
2nd Jul 2018, 8:46 PM
Ivan Stoyanov
Ivan Stoyanov - avatar
+ 1
Also i don't understand why you want to return there. It achieves nothing. Are you sure you don't want to move the document.write below the return statement.
2nd Jul 2018, 9:09 PM
josh mizzi
josh mizzi - avatar
0
Thanks all I underestood
3rd Jul 2018, 8:23 AM
Sina
Sina - avatar