> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# clearInterval() global function

APISummary
Cancels the timer set by `setInterval`.

## Syntax

```typescript
clearInterval(timerId: number): void;
```

### Parameters

#### timerId

The timer ID returned by `setInterval`.
\*\* Passing in an ID value other than the one returned by `setInterval` is undefined behavior and may cause problems. \*\*

## Example

## Notices

1. `setTimeout()` and `setInterval()` have a shared pool of ID numbers, so technically `clearTimeout()` and `clearInterval()` are interchangeable. However, for clarity, you should avoid doing so.

## Compatibility

**Compatibility Table**

**Query:** `lynx-api.global.clearInterval`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-api/global/clearInterval.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| clearInterval | Yes (1.3) | Yes (3.4) | Yes (1.3) | Yes (3.5) | Yes (3.5) | Yes |

**`clearInterval`**

Cancels the timer set by `setInterval`.

**Specifications:**

