Ask coding questions

← Back to all posts
How to clear terminal in JavaScript?
Michael_Nicol

I wanted to know if their is anyway i can clear the repl.it terminal with JavaScript? I can only find stuff for Python and such but nothing for JS.

Answered by mat1 [earned 5 cycles]
View Answer
Voters
SagaciousPan
Michael_Nicol
Comments
hotnewtop
mat1

Currently, it is not possible to clear the screen in the NodeJS terminal due to it not using Repl.it's new terminal (xterm.js)
Please mark this comment as the answer if it answered your question. Thanks!

Michael_Nicol

@mat1

This is odd.So they implemented the console and gave everyone little control over it? When will be able to use the new terminal?

RahulChoubey1

@Michael_Nicol Probably never(or at least, not anytime soon). The Replit devs often don't update their current languages because even one tiny mistake can break everyone's programs using that language.

Michael_Nicol

@RahulChoubey1 Fair enough. It is not a good practice for me to rely on the console on repl.it anyways. I can use other dev tools or create my own if needed.

Pythonier

You could use this, it is a bit ugly though,

That will make it appear as if the console was cleared. You can change the 50 to fit your needs.

Michael_Nicol

@Pythonier The Issue with mine was that it was a brute force combination calculator that would display 22,500 console text lines per minute. each line gave data on what the program was doing. I wanted to clear the console every 1000 in order to prevent it from lagging.

Pythonier
Geocube101

Try console.clear()

Michael_Nicol

@Geocube101 Doesn't work