avatarKirti K

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

3003

Abstract

console.</p><p id="d424">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.</p><p id="66ef">Usage</p><div id="62c4"><pre>function <span class="hljs-built_in">getAddress</span>() { console<span class="hljs-selector-class">.trace</span>(); }

function <span class="hljs-built_in">getEmployeeDetails</span>() { console<span class="hljs-selector-class">.log</span>('getEmployeeDetails'); <span class="hljs-built_in">getAddress</span>() }</pre></div><figure id="9c78"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*0NQZzzFajsK1Dx0RxOg4Cg.png"><figcaption></figcaption></figure><p id="3853">Other method’s for Console Web API ‘s — Please follow below link for other useful methods.</p><div id="6e15" class="link-block"> <a href="https://developer.mozilla.org/en-US/docs/Web/API/console"> <div> <div> <h2>console - Web APIs | MDN</h2> <div><h3>The console object provides access to the debugging console (e.g., the Web console in Firefox). The specifics of how it…</h3></div> <div><p>developer.mozilla.org</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*Li9cbRpZVUh-Thiw)"></div> </div> </div> </a> </div><h2 id="6dbe">Tomorrow we will learn more about console with demo webpage.</h2><h2 id="652b">Our Tomorrow Topic — Debugging with the console in web browsers like Chrome, Firefox, and Safari.</h2><h1 id="7534">Happy Coding and Stay Tuned :)</h1><p id="8f53" type="7">Kind is cool !!!</p><p id="562a" type="7">Share knowledge to gain knowledge !!!!</p><p id="def9" type="7">Be kind and treat people with respect !!</p><h1 id="ec61">If you find my blog helpful, then please subscribe, claps and follow to support :)</h1><figure id="1468"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*qyWxIYVNrI8R85vHvgoffw.png"><figcaption>JavaScript Day 26 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation with Kirti Kaushal</figcaption></figure><div id="a44f" class="link-block"> <a href="https://kirtikau.medium.com/list/6d895127c989"> <div> <div> <h2>100 Days of JavaScript Interview Prep: A Beginner’s Journey</h2> <div><h3>Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation (00 Days of JavaScript Interview Prep: A…</h3></div> <div><p>kirtikau.medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*e2b007ac8115146f466e768d9710022c43cba1a5.jpeg)"></div> </div> </div>

Options

</a>
    </div><div id="a884" class="link-block">
      <a href="https://readmedium.com/javascript-day-25-mastering-javascript-basics-a-comprehensive-guide-for-interview-preparation-16f6a5aeba67">
        <div>
          <div>
            <h2>JavaScript Day 25 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation</h2>
            <div><h3>100 Days of JavaScript Interview Prep: A Beginner’s Journey</h3></div>
            <div><p>medium.com</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*uBH7UYRDH9VbcKq0r17RJg.png)"></div>
          </div>
        </div>
      </a>
    </div><div id="ab6d" class="link-block">
      <a href="https://kirtikau.medium.com/javascript-day-24-mastering-javascript-basics-a-comprehensive-guide-for-interview-preparation-78103a0fad48">
        <div>
          <div>
            <h2>JavaScript Day 24 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation</h2>
            <div><h3>100 Days of JavaScript Interview Prep: A Beginner’s Journey</h3></div>
            <div><p>kirtikau.medium.com</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*BYfiskwRyZ_f4KP4myKxwQ.png)"></div>
          </div>
        </div>
      </a>
    </div><div id="e727" class="link-block">
      <a href="https://readmedium.com/javascript-day-21-mastering-javascript-basics-a-comprehensive-guide-for-interview-preparation-8bf7b49d7a48">
        <div>
          <div>
            <h2>JavaScript Day 21 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation</h2>
            <div><h3>100 Days of JavaScript Interview Prep: A Beginner’s Journey</h3></div>
            <div><p>medium.com</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*GZTiBZrCQtFX3U8Zb9c31w.png)"></div>
          </div>
        </div>
      </a>
    </div><div id="07c5" class="link-block">
      <a href="https://rohitsportsphysiorehabclinic.co.in/?source=post_page-----8bf7b49d7a48--------------------------------">
        <div>
          <div>
            <h2>Home - Krishna Sports Injuries Physiotherapy &amp; Rehab Clinic</h2>
            <div><h3>Krishna Sports Injuries Physiotherapy &amp; Rehab Clinic There are plenty ways how to make an appointment. You can call us…</h3></div>
            <div><p>rohitsportsphysiorehabclinic.co.in</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*atwPDcm06lC_h_DD)"></div>
          </div>
        </div>
      </a>
    </div></article></body>

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 :)

JavaScript Day 26 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation with Kirti Kaushal
JavaScript
Coding Interviews
Javascript Interview
Frontend Interviews
Javascript Tips
Recommended from ReadMedium