global.clearTimeout
Cancels an id from setTimeout or setInterval, which share ids; undefined is ignored.
Usage
Cancel a pending timer.
// Cancel a pending timer.
const reminder = setTimeout(() => console.log('Still there?'), 30_000);
// The user came back first: the reminder never shows.
clearTimeout(reminder);Signatures
(id: number | undefined): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
id | number | Yes | — |
Returns
void
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.