Over a million developers have joined DZone.

How to Clear the JavaScript Console in Google Chrome or Firebug Programmatically

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.


If  you are extensively working with the console in the chrome developer tools and the console in Firefox/firebug and you find the need to clear the console many times while you are testing your code, both Chrome and Firefox have a feature that lets you do that programmatically.


Chrome
clear()

Firefox
console.clear()


I feel that the Firefox version of the command makes more sense. I have absolutely no idea why the Chrome guys chose to do it differently.

If you are a mouse person, in chrome, you can use the context menu and select Clear Console. If you are using firefox instead, you can use the clear button on top of the firebug console. But I guess you know that already.

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.

Topics:

Published at DZone with permission of Ryan Sukale. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}