Ask coding questions

← Back to all posts
console clear for JS?
Nanowrimoijk (43)

Can we get a console clear command for JavaScript? It would be really nice especially since I am making a text-based game engine and i would like it to not fill the console.

Answered by Vandesm14 (2218) [earned 5 cycles]
View Answer
vedprad1 (860)

Try console.clear();

Nanowrimoijk (43)

@vedprad1 nope does not work, thats why I made this post

Klokat (42)

@Nanowrimoijk Could you give us more info? Is this on the browser? Are you using nodejs? What is the expected behavior? And what do you get instead?

vedprad1 (860)

@Nanowrimoijk : Could you provide the link to your repl? Thanks!

Nanowrimoijk (43)

@vedprad1 @Klokat all i was saying was it would be nice to have a console.clear command. thats it

Vandesm14 (2218)

@Nanowrimoijk Console.clear should work. If it does not, it might be a problem with your code. Could you provide a link to your repl?

If it's just a suggestion for a command there is no need as the command already exists and is confirmed to work on

Please mark this as answered if I helped your problem

Vandesm14 (2218)

@Nanowrimoijk I see the problem. does not support a ton of console features in the editor, so for this to actually work you'd have to run it here: (you can also get there via the link which is right on top of the console view.