+ 2
Any way to clear the console in Code Playground (web)?
Is there a way to clear the JavaScript console in Code Playground? console.clear() doesn't work.
5 Answers
+ 6
Once the console appeared, you can't get rid of it until you rerun your code.
+ 8
best way is to catch all exceptions and console.log( " ");
+ 5
The best I've been able to do is shut it off entirely; and to reliably catch 100% of the code errors I had to go all the way up to a <HEAD> include.
Here, I catch errors and Promise exceptions (and I reroute them to: Silence, a popup, callback or send errors to yourself remotely):
https://code.sololearn.com/WWKt0cidbM9p/?ref=app
...and this one disables all console functions (to silence included code, really):
https://code.sololearn.com/WLxYacmLKBMI/?ref=app
You'll notice the "verbose" nullify (there's a shorter version in the code too) lists all the console methods it's disabling.
Finally, none of this intercepts iframe errors (unless the iframe agrees to communicate with SoloLearn).
I went to this length to fix line number / tab detection and also because, as @The Coding Sloth said, once the console appears it seems to be permanent.
+ 1
@Nomeh: that just adds an empty line, it does not clear the console log
+ 1
@Kirk Schafer:
Very nice work you have done there. Like it. I'll take a look at your code when I find some more time.