Complete Guide on JavaScript Console.log()

Complete guide on console.log

If you ever worked on developing web application with JavaScript, You will be familiar with console.log() Console.log is a function that is commonly used in JavaScript programming. It allows developers to output messages to the browser’s console, providing a way to troubleshoot and debug their code.

The syntax for using console.log is relatively simple. Simply type “console.log” followed by a set of parentheses and the message you want to output within the parentheses. Running the following code, you will find there is so much going on in the console.

console.log( console );

The console message will be 👇

log the console object | console.log | Code Architects

In this blog we will briefly talk about top tricks in the console method.


the most used method. It prints the message in the console. Useful when debugging & testing.

console.log("Hello World");
Console.log simple message | Code Architects


The JavaScript console.table() method is a powerful tool for debugging and analyzing data. It allows you to log arrays or objects in a tabular format, making it easier to visualize and understand the data. The console.table prints the arrays/object in a tabular format. You can use the table to log iterable objects.

    'firstName': 'John',
    'lastName': 'Doe'
Console table | Code Architects

In addition to logging data, console.table() also provides options for sorting and filtering the output. You can use the sort and filter options to control which rows are displayed in the table.


The JavaScript console.error() method is used to log error messages to the console. It is similar to the console.log() method, but it also displays the message in a different color (usually red) to make it more noticeable. Use console.error to log errors in the console.

console.error("This is a error, Hehe...");
Javascript Console error message | Code Architects

Using console.error() can help you identify and debug issues in your code. For example, if you have a syntax error or a reference error, console.error() can help you quickly locate and fix the problem.


the console.warn logs the warning.

console.warn("Warning message");
JavaScript Console.log warning | Code Architects


the console.clear will clear the console panel of browser.

clearing the console.log panel | Code Architects


In console panel, you can group multiple messages under a single name."Group Title");
console.log("Message 1");
console.log("Message 2");
console.warn("Message 3");
console.groupEnd("Group Title");
image 8


count a console message that is logged in the panel.

image 9

Overall, console log is an essential tool for any JavaScript developer. It allows you to output messages and data to the console, providing a way to troubleshoot and debug your code. Whether you are just starting out with JavaScript or are an experienced developer, console log is a valuable tool to have in your arsenal.

Follow us on Instagram here. Read our other blogs here 👇

Thank you for reading the blogs, What do you think about the blog? let us know in the comment box.

Leave a Comment


No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

fourteen + 14 =