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.
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?
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.