 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Clear the JavaScript Console in Google Chrome
In this article we are going to learn how to clear the JavaScript Console in Google Chrome. We have various methods to clear the console; but our question is why do we need to clear the console?
Sometimes we have lots of commands and logs printed in any browser console which makes it look substandard and packed with output. So, we need to clear the console. And there are multiple ways to clear the console of google chrome.
Using the console.clear() method
This method will clear the console and display the message on the console that the console was clear.
Example
Following is the example of the console.clear() method ?
<!DOCTYPE html> <html lang="en"> <body> <p>Please click the clear button to clear the console.</p> <button onclick="clearFunc()">clear</button> <script> function clearFunc() { console.clear(); } </script> </body> </html>  - We can also use the keyboard to clear the console. (Ctrl + L) 
- We can also use the clear log button on the top left corner of the chrome dev tools console to clear the console. 
in the following screenshot, we have marked a circle on the clear log button.
- On the macOS we can use (Command + k) for clear the log. 
