Report post

What is console log?

console.log refers to the console object used for debugging. for firefox i use firebug for example. but if the console is not available the script will crash. so window.console checks if the console object is there and if so it uses its log function to print out some debug information. 2.) Does it have to be in the code?

How do I send a log message to the console?

Open the demo webpage Console messages examples: log, info, error, and warn in a new window or tab. Press Ctrl + Shift + J (Windows, Linux) or Command + Option + J (macOS). DevTools opens, with the Console open in main toolbar. The demo page has already sent the above log messages to the Console:

How do I open a console message in DevTools?

Open the demo page Console messages examples: Grouping logs in a new tab or window. Press Ctrl + Shift + J (Windows, Linux) or Command + Option + J (macOS). DevTools opens, with the Console open in main toolbar. The webpage has already populated the Console with output.

What is a console object in JavaScript?

The console object is an extension to the DOM. The console.log () should be used in code only during development and debugging. It’s considered bad practice that someone leaves console.log () in the javascript file on the production server.

Related articles

The World's Leading Crypto Trading Platform

Get my welcome gifts