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

# console: count() method

APISummary
`count` 方法用于记录该特定调用 count() 的次数。

## 语法

```ts
count(label: string?): undefined;
```

### 参数

#### label

字符串。如果提供，count() 输出该标签已调用的次数。如果省略，count() 的行为就像是用 "default" 标签调用的。

### 返回值

无（`undefined`）。

## 兼容性

**Compatibility Table**

**Query:** `lynx-api.global.console.count`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-api/global/console/count.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| count | Yes (3.2) | Yes (3.4) | Yes (3.2) | Yes (3.5) | Yes (3.5) | Yes |

**`count`**

start count

