The console is a panel that displays important messages, like errors, for developers. Much of the work the computer does with our code is invisible to us by default. If we want to see things appear on our screen, we can print, or log, to our console directly.
One action, or method, that is built into the
consoleobject is the
.log() method. When we write
console.log() what we put inside the parentheses will get printed, or logged, to the console.
It’s going to be very useful for us to print values to the console, so we can see the work that we’re doing.
This example logs
You’ll see later on that we can use
console.log() to print different kinds of data.