HTML DOM console.clear() method
Example
Clear all information on the console:
console
.
clear
(
)
;
Try it »
Definition and Usage
The console.clear() method is used to clear all information on the console.
After the console.clear() method executes successfully, it outputs "Console was cleared" on the console.
Syntax
console.clear()
Browser support
The numbers in the table indicate the first browser version that supports this method.
| Method | |||||
|---|---|---|---|---|---|
| console.clear() | Yes | Yes | 48 | Yes | Yes |
Console object