You type your code in the middle of the three sections. The section on the left provides instructions for the exercise, the middle section is a code editor, and the section on the right is the console. The console is where the results of the code typed in the code editor are displayed.
As I understand it: console.log writes to the console which is like a test area for seeing how JavaScript will work (or not). Document.write is an actual JavaScript object/method that when executed will write something to a webpage. Is this conceptually correct? BUT I DO HAVE ANOTHER QUESTION: when using a text editor (I downloaded ATOM), is there a way to easily copy and paste code directly from the console back to an html page that’s been opened in the ATOM text editor (between the Scripts tags). The only way I can figure out how to copy and paste from Console is to first save the console lines as a text file, then copy the individual lines from the text file back to the actual web page document. Very cumbersome. I’m pretty new here so please be nice!
When I try to add a new line to put a different code it won’t let me. (either that or I don’t know how.) Can someone tell me how to add a different line?
Your illustration shows nicely as I understand how you would write “example’s” output if you had typed it in console.log on a browser’s console (I use the Chrome console) and also shows the separate way you would embed code between script tags to write the “example” to web page. But my question is this : let’s say you’ve carefully worked out using the Chrome consol maybe 10 lines of code - everything is nice, no errors, ect. Now you want to copy collectively (all in one copy) those lines from the console into your web page file (which for discussion I’ve opened in ATOM), Is this possible by some simple copy and paste procedure which I can’t figure out? Same question in reverse : is there a simple way to copy and paste lines collectively together from an open html file from ATOM (I’m only interested in the JavaScript part of the file for discussion) back to console to work out errors? Thank for any continuing help - I really appreciate it!
So the console is simply the panel that displays what we are coding in real time?
Also, when we put a number in the parenthesis, console.log(28); ,does that number trigger an action? what is that action? because I only see it displayed on the console panel, I’m not sure what it’s doing. Also when I put a word in the parenthesis it shows a long red message, looks like a error message. I’m assuming you only can use numbers for .log() action to represent data about the value of something.