console.clear()

The console.clear() method clears the console if the environment allows it.

Syntax

clear()

Parameters

None.

Return value

None (undefined).

Specifications

Specification
Console Standard
# clear

Browser compatibility

BCD tables only load in the browser