Skip to content

console.clear()

Description

The console.clear() method clears the console output, removing all previously registered messages. This is useful for resetting the console and ensuring a clean working space during debugging or logging new information.

Syntax

JS
console.clear() -> void

Return value

Type Description
void An empty value.

Example

JS
console.clear();
Last update: 14 August 2025, 18:47