Skip to main content
Console.count - node__console.d.ts - Node documentation
method Console.count

Usage in Deno

```typescript import { type Console } from "node:node__console.d.ts"; ```
Console.count(label?: string): void
Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`. ```js > console.count() default: 1 undefined > console.count('default') default: 2 undefined > console.count('abc') abc: 1 undefined > console.count('xyz') xyz: 1 undefined > console.count('abc') abc: 2 undefined > console.count() default: 3 undefined > ```

Parameters

optional
label: string = 'default'
The display label for the counter.

Return Type

void