Console clear()

Example

Clear all messages in the console:

console.clear();
Try it Yourself »

Description

The clear() method clears the console.

The clear() method also write "Console was cleared" in the console.


Syntax

console.clear()

Browser Support

console.clear() is supported in all browsers:

Chrome Edge Firefox Safari Opera IE
Yes Yes Yes Yes Yes Yes


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.