Skip to content
← Back to Community
Console.log not working?
Profile icon
h
has Hacker Plan
TheSatIsBack

I am trying a basic print function, however Console.log isn't working, neither is alert.

Voters
Profile icon
JohnPeter07
Profile icon
jamariaxsims
Profile icon
NikiDanilov
Profile icon
Puspesh
Profile icon
MaxiMuss007
Profile icon
TheSatIsBack
Comments
hotnewtop
Profile icon
vedprad1

First of all, console.log() should be all lowercase.

As for alert(), that will not work in node.js because node.js is server side. alert() is a function that is used only in client side, when HTML and CSS are involved. If you want to use alert(), you have to go to an HTML, CSS, JS repl.

If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!

Profile icon
davidwbandel

@vedprad1 what's with all the irrelevant responses on repl.it asks? they said nothing about node.js

jesus christ node.js is a tiny minority of the use cases involved with js.

Profile icon
PCWCFA

I found that my console.log() was working. It's just that the console is not refreshing and showing the output of console.log() unless I navigate to a different pane such as the Shell or the Markdown pane.

console.log('TEST', process.env['MESSAGE_STYLE'], typeof(process.env['MESSAGE_STYLE']));

Console on Run:

image

After navigating to Shell and then back to Console:
image

Profile icon
Zavexeon

Console should be lowercase, like console.log();.