The last example for window.clearTimeout() method has an explanation that appears to be inconsistent with the 'try it yourself' example on the JavaScript Timing Events page. I have put the text needing corrected in red: How to Stop the Execution?The clearInterval() method is used to stop further executions of the function specified in the setInterval() method. Syntaxwindow.clearInterval(intervalVariable)
The window.clearInterval() method can be written without the window prefix.
To be able to use the clearInterval() method, you must use a global variable when creating the interval method: