🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to JavaScript Notes
Topic #110

Debug Console

Console Like a Pro

The browser console is the most important debugging tool for JavaScript beginners.

If you learn how to use the console properly, you will find bugs faster and understand your code better.

How to Open the Console

In Chrome or Edge, open the console like this:

  • Right-click anywhere on the page
  • Click Inspect
  • Click the Console tab

Note: The console is where JavaScript shows errors, warnings, and messages from your code. Always keep the console open when testing new JavaScript code.


console.log()

The most common console method is console.log().

Use it to print values and see what your program is doing.

Examples

console.log("Hello from JavaScript!");

console.warn()

Use console.warn() to display warnings.

Warnings tell you something might be wrong, but your code can still run.

Example

console.warn("This is a warning!");

Note: Use warnings when you want to highlight something suspicious in your program.


console.error()

Use console.error() to display error messages.

Errors show that something has failed.

Example

console.error("Something went wrong!");

Logging Multiple Values

You can log more than one value at once.

Example

let x = 10;

let y = 5;

console.log("x =", x, "y =", y);

Inspecting Objects

The console is very useful for inspecting objects.

Example

let user = {name: "John", age: 25};

console.log(user);

Note: In the console, you can click the object to expand it and see its properties.


console.table()

Use console.table() to display data in a table format.

Example

let users = [

  {name: "John", age: 25},

  {name: "Anna", age: 30}

];

console.table(users);

Note: Tables make it much easier to debug arrays of objects.


Debugging Tip: Stop Guessing

Beginners often guess what the value is.

Professionals log the value and confirm it.

Warning: If your code is not working, do not guess. Use console.log().


Next: Breakpoints, Watch, Scope

Logging is powerful, but sometimes you need to pause code execution.

Next page: Learn how to use breakpoints, step through code, and watch variables live.

Want to go beyond the notes?

Join CodingNow 2.0's JavaScript course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Debug Console – FAQs

Quick answers about learning Debug Console in JavaScript.

This free note from CodingNow 2.0 explains Debug Console in JavaScript — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every JavaScript topic on CodingNow 2.0, including Debug Console, is 100% free with no signup required.
With focused practice, most students grasp Debug Console in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now