Logging to console

@stetim94, does your explanation on the previous topic:
I get to pass the exercise but I am not sure if its the right answer
applies on here as well?

I’m quite curious about this issue myself. Tried it on CC lab, it prints

=> 28

So, the console will output last value by default every time?

I tried it on Jsfiddle, it didn’t output anything.

Where can I read more on which console that does that vs which is not, and what is the appropriate term to search for, searched “console behavior” comes out with slightly complicated results.

Thanks for the help! :slight_smile:

no, as you experienced on jsfiddle and jsbin it doesn’t output anything

Isn’t the output window in jsfiddle a html page? I don’t think that is a console window, that is quit a difference


Ah, I just realized that, the ‘result’ part in Jsfiddle should be the page of HTML, CSS and JS combined. I got that confused. No wonder it didn’t output anything.

So any console window will behave the same?

I found this

Is this the same thing we’re talking about console window? :confused:

very similar, yes. But does it matter? Console is used for debugging, so you only need to understand the console you are working in .

all browser come with a console window, this are shells in which you can actively run code.


Have had this question in mind for some time, seeing how sometimes CC console output with weird results. The console printed things that are not expected.

I know this got to do with the checking system behind, still, a bit unsure how it happened. Therefore, kinda curious about how console works.

Thanks for the clarification, I get the difference now. :grinning:

this has nothing to do with console or console behavior. This has to do with codecademy and the validation (SCT, submission correctness test)

But why codecademy does specific things in a certain way is not very interesting while learning the fundamentals of programming.

curiosity is a good thing as programmer, but i personally think this interest would be better spend on something else then SCT

1 Like

Thanks for the reply @stetim94, noted that and appreciate the explanations! :slight_smile: