JavaScript Console

You are Here:

JavaScript Console

JavaScript Console is the heart of JavaScript / nodejs developer which allows developers to log data and debug their application.

Log Data to Console

In the following example, we will learn how to log data to the console.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <p>Please check your console (Press F12).</p> <script> console.log("Hello world"); </script> </body> </html>

Debug using Console

In the following example, we will debug our JavaScript program using the console.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <p>Please check your console (Press F12).</p> <script> // replace alerrt() with alert() alerrt("Hello world"); </script> </body> </html>

How to Open Console?

Note: If you are a Mac user, use cmd instead of ctrl.

For Chrome, do any one of the following

  • Press F12 and navigate to console tab.
  • Press ctrl + Shift + i and navigate to console tab.
  • Click on the browser menu ⋮ (in top right corner) > More tools > Developer tools and navigate to console tab.

For Firefox, do any one of the following

  • Press F12 and navigate to console tab.
  • Press ctrl + Shift + i and navigate to console tab.
  • Click on the browser menu ☰ (in top right corner) > Web Developer > Web Console and navigate to console tab.

For Internet Explorer, do any one of the following

  • Press F12 and navigate to console tab.
  • Press ctrl + Shift + i and navigate to console tab.
  • Click on the browser menu ✳ (in top right corner) > F12 Developer tools and navigate to console tab.

For Safari, Press Ctrl + Alt + i

Reminder

Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in JavaScript.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author