What is the console used for?
The console can be used to log information as part of the JavaScript development process as well as interact with a web page by carrying out JavaScript expressions within a pageâs context.
How do you open the Console in Google Chrome?
Long Way: Navigate to the menu at the top-right of the Chrome browser signified by the three vertical dots in a row. Select âMore Toolsâ, then âDeveloper Tools.â This will open a panel where you can click on Console along the top menu bar to bring up the JavaScript Console.
Short Way:
On Windows or Linux, use the keyboard shortcut by pressing CTRL + SHIFT + J.
On macOS, press COMMAND + OPTION + J.
What does console.log function do?
console.log function enables to log in an expression inside the Console.
How can you change the contents of an HTML page through the console?
You can edit the contents of an HTML page using the JavaScript element documen.body.innerHTML.