144 of 264 menu

clearTimeout function

The clearTimeout function stops the timer set by the setTimeout function. The function takes the id of the timer to stop. The timer ID is returned by the setTimeout method.

Syntax

clearTimeout(identifier);

Example

Stop the timer when the counter reaches the value 10:

let i = 0; let id = setInterval(function() { i++; if (i == 10) { clearTimeout(id); } else { console.log(i); } }, 1000);

See also

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline