clear javascript console in Google Chrome
There's always the good ol' trick:
console.log("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
or a shorter variation of the above:
console.log('\n'.repeat('25'));
Not the most elegant solution, I know :) ... but works.
For me, I usually just print a long "-----" separator line to help make the logs easier to read.
Update:
console.clear()
is available in all browsers
Update: As of November 6, 2012,
console.clear()
is now available in Chrome Canary.
If you type clear()
into the console it clears it.
I don't think there is a way to programmatically do it, as it could be misused. (console is cleared by some web page, end user can't access error information)
one possible workaround:
in the console type window.clear = clear
, then you'll be able to use clear in any script on your page.