JavaScript Console Clearing the console - console.clear()


Example

You can clear the console window using the console.clear() method. This removes all previously printed messages in the console and may print a message like "Console was cleared" in some environments.