The console is a special part of web browser aimed for developers. It helps us see what’s going on in our code. To make something appear in the console, we can print it with the log command.
One of the methods of the console object is the .log(). So, when we write console.log(), the computer will print what we put inside the parentheses.
It’s extremely useful, especially if you want to find out the values stored in the memory.
This example logs (prints) 5 to the console.
Notice that the code ends with a semicolon. It’s a good habit of ending each statement (line of code) with it.
Time to code!
Type the code above and hit Enter. You should see 5 printed on the line below the code.