JavaScript Day 26— Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation
100 Days of JavaScript Interview Prep: A Beginner’s Journey

Welcome to Day 26–100 Days of JavaScript Interview Prep: A Beginner’s Journey
Embarking on a 100-day adventure focused on learning, practice, and growth sounds like an incredibly rewarding journey.
DAY 26 (April 17th, 2024) — Console API or debugging method in JavaScript?
What do you understand by console.info, console.error, console.trace and console.warn?
Answer —
As of now, we understand based on our yesterday article that console is Web API and used for access debugging code, interaction with browser’s console in various useful methods.
Similarly, console.info and console.error are helpful in different way of debugging code and interaction with our applications.
Why Logging or Debugging Methods are important ?
Logging is important and essential part to understand the user journey and application development process.
Once our application is in production with real users then every track of step is important to troubleshoot the issues for our debugging, monitoring and performance.
These are crucial design methods for our application development.
Now let’s start our original question —
What do you understand by console.info, console.error, console.trace and console.warn?
Console.info
info means information
Console.info is a static method used to outputs an informational message to the console.
Usage
console.info('this is info message');Console.error
error means error message
Console.error method writes an error message to the console. This is very useful for testing purposes.
Usage
console.error('this is info message');Console.warn
warn means warning message
Console.warn method writes a warning message to the console.
Usage
console.error('this is warning message');Console.trace
trace means tracking down
Console.trace method print a stack trace to the console.
It is useful for current call track to the console, which help in identifying the function calls in the order they call. This is very useful for tracking the source of errors by getting the complete call stack of execution of code of functions.
Usage
function getAddress() {
console.trace();
}
function getEmployeeDetails() {
console.log('getEmployeeDetails');
getAddress()
}
Other method’s for Console Web API ‘s — Please follow below link for other useful methods.
Tomorrow we will learn more about console with demo webpage.
Our Tomorrow Topic — Debugging with the console in web browsers like Chrome, Firefox, and Safari.
Happy Coding and Stay Tuned :)
Kind is cool !!!
Share knowledge to gain knowledge !!!!
Be kind and treat people with respect !!
If you find my blog helpful, then please subscribe, claps and follow to support :)






