+ 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.

16th Jul 2017, 10:46 PM
Pete Wright
Pete Wright - avatar
5 Answers
+ 6
Once the console appeared, you can't get rid of it until you rerun your code.
16th Jul 2017, 11:03 PM
The Coding Sloth
The Coding Sloth - avatar
+ 8
best way is to catch all exceptions and console.log( " ");
16th Jul 2017, 10:47 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
+ 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.
16th Jul 2017, 11:32 PM
Kirk Schafer
Kirk Schafer - avatar
+ 1
@Nomeh: that just adds an empty line, it does not clear the console log
16th Jul 2017, 10:56 PM
Pete Wright
Pete Wright - avatar
+ 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.
18th Jul 2017, 3:30 PM
Pete Wright
Pete Wright - avatar