Skip to content
Sign upLog in
← Back to Community

Possible to remove things from console.log in javascript?

Profile icon
OtakuDraken

I'm using an async function for my dice roller and I'm wondering if there's a way to remove the green text from the log so it doesn't split the text.

Cannot infer image mime type

Voters
Profile icon
OtakuDraken
Comments
hotnewtop
Profile icon
Battledash2

Maybe you could clear the console? There's a clear() function built in but I'm not sure if that works directly from the code.. Try

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\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\n\n\n\n');

right after the promise.

I don't think there is a way to "remove" it, but I can tell you that in the actual console it's not green. Only on the repl.it. Now this is node so the browser can't actually "run" it but for example Visual Studio Code's Terminal, Command Prompt & Even Windows Terminal will not display it in green! :D

Profile icon
CiSte

I suppose your async function diceR is called directly a top level, so the green text is the returned promise.
Try assign it to a variable, const rollingP = diceR();