How to Use Console.log in Javascript

The Javascript command console.log allow us to “Print Out” to the console.  When you need to see what the computer is processing you have to ask it to show you.  The correct way to write the code is like this:

console.log("show everything between these parentheses")

This command will log to the console anything within the parentheses including strings and equations. Here are two examples:

console.log(8 * 10);
console.log("Nice to be able to see what the interpreter, the computer, is working on.");

How to Create a Comment in Javascript

Javascript’s comment symbol is the dual // at the beginning of the line.

Comments become helpful when writing Javascript. Using the comment function forces the computer to ignore or skip everything else on the line. Comments let us separate sections of the code, write reminders and notes, annotate where snippets came from, and let us disable lines of code for troubleshooting.

Example:

//This is a comment.
//The computer executing Javascript will ignore everything after the dual forward slashes.