avatarKirti K

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

3632

Abstract

tools.</p><p id="483e"><b>Let’s now understand how we can see console.log in our dev tool.</b></p><p id="c9b8"><b>Step 1 — Open Dev tool</b></p><p id="3495"><b>Step 2 — Navigate to Console Panel</b></p><figure id="fce7"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*cqIVk6deGbD2oTvedgYzHA.png"><figcaption><b>Devtool — Navigate to Console Panel</b></figcaption></figure><p id="bc19"><b>Step 3 — Viewing Console Message — Default view</b></p><figure id="43dd"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*u2am4IQY1QjA1-PzgYJYog.png"><figcaption><b>Devtool —Viewing Console Message — Default view</b></figcaption></figure><p id="719a"><b>Step 4 — Logging Message to the Console window</b></p><p id="9942">Open any website and toggle on/off highlight —</p><p id="f36d"><i>You will notice of appearing and disappearing of console based on selection</i></p><figure id="e805"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*06-g6upjC3mX4FOHPRJ4Kg.png"><figcaption><b>Devtool — Logging Message to the Console window</b></figcaption></figure><p id="3cce"><b>b) Error Console Logs Appearance</b></p><p id="3de3"><b>— always appear in Red</b></p><figure id="4f4d"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*URHG2Oh49MVV6a-rQh6rqQ.png"><figcaption><b>Error Console Logs Apperance (Red in color)</b></figcaption></figure><p id="e012"><b>c) Side panel Console Panel window</b></p><ul><li>In the Side Console panel, We can GUI interface with all Methods</li><li>Any messages logged to the console by the web page will also appear here.</li></ul><figure id="7b9b"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*7PUwtbagDzZLb0w0gkfwIA.png"><figcaption></figcaption></figure><p id="6c84"><b>d) Clearing the Console</b></p><ul><li>If the console gets too cluttered, We can clear it by clicking the “Clear console” button (usually a circle with a line through it)</li></ul><figure id="f1d0"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Ur29AQU09Qke_yCt6op7mw.png"><figcaption></figcaption></figure><p id="c3b9"><b>e) Executing JavaScript in the Console</b></p><ul><li>You can directly execute JavaScript code in the Console panel by typing it into the command line interface and pressing Enter.</li></ul><figure id="1da6"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*abuPxC2upwFZpXbeZHBQHw.png"><figcaption><b>Executing JavaScript in the Console like const a= 2</b></figcaption></figure><p id="c962"><b>f). Filtering Messages</b></p><p id="1030">a) If there are too many messages in the console, you can filter them by clicking on the filter icon (usually a funnel-shaped icon)</p><p id="aebf">b) Selecting the types of messages you want to see (e.g., Errors, Warnings, Logs).</p><figure id="2bd8"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*b5K1F7Qa8Yda2_32LKLeUw.png"><figcaption><b>Filtering Messages — Console DevTool</b></figcaption></figure><h1 id="3cd0">Happy Coding and Stay Tuned :)</h1><p id="7f2c" type="7">Kind is cool !!!</p><p id="363f" type="7">Share knowledge to gain knowledge !!!!</p><p id="1ca7" type="7">Be kind and treat people with respect !!</p><h1 id="be2d">If you find my blog helpful, then please subscribe, claps and follow to support :)</h1><figure id="c656"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*g8ADiwAl_FXvOBG8ZfaObg.png"><figcaption>JavaScript Day 27 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation with Kirti kaushal</figcaption></figure><div id="6caa" class="link-block"> <a href="htt

Options

ps://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> </a> </div><div id="b682" 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="218f" 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="c9f4" class="link-block"> <a href="https://kirtikau.medium.com/javascript-day-26-mastering-javascript-basics-a-comprehensive-guide-for-interview-preparation-ba37d3417729"> <div> <div> <h2>JavaScript Day 26— 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*TKV6_goqwM2UK3kxV1aYnA.png)"></div> </div> </div> </a> </div><div id="f0b2" class="link-block"> <a href="https://rohitsportsphysiorehabclinic.co.in/?source=post_page-----ba37d3417729--------------------------------"> <div> <div> <h2>Home - Krishna Sports Injuries Physiotherapy & Rehab Clinic</h2> <div><h3>Krishna Sports Injuries Physiotherapy & 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*up8A0G0avp3Tn7vr)"></div> </div> </div> </a> </div></article></body>

JavaScript Day 27 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation

100 Days of JavaScript Interview Prep: A Beginner’s Journey

JavaScript Day 27 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation With Kirti Kaushal

Topic —Understanding JavaScript debugging tools

Get started debugging JavaScript

Debugging is the process of identifying and resolving errors or bugs within our code.

It involves inspecting the code’s behavior, finding the root cause(RCA) of unexpected behavior, and helping in corrections.

Step 1 — How to open Developer Console

Command Process

To open DevTools, right-click the webpage, and then select Inspect. Or, press Ctrl+Shift+I (Windows, Linux) or Command+Option+I (macOS). DevTools opens:

1. Press F12 or right click and press Inspect

or

2. You can also use Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux

or

press Ctrl+Shift+I (Windows, Linux) or Command+Option+I (macOS). DevTools opens:

or

Manual Process

To open the developer console in Google Chrome,

  1. open the Chrome Menu in the upper-right-hand corner of the browser window
  2. select More Tools > Developer Tools.
Developer console in Google Chrome — Developer Tools window

How to INTERACT WITH DEV TOOL and start your debugging journey.

Debugging is the most important skill of any programmer to identify the issue.

Chrome Dev tool is the most powerful tool for debugging the JavaScript.

STEP 2 — Dev Tool Panels

As per our above image attached — Dev tool will be available, and we can now explore below panel as per our requirement of debugging.

  1. DevTools opens the Elements panel and selects the element in the DOM tree. It will help to inspect the element in DOM and CSS

2. Dev Tools open the Console, Sources, Network, Performance, Memory, Application, Security, Lighthouse which help us to identify the activity of any web application for debugging various area’s.

3. Lighthouse — We can monitor performance and load by using lighthouse panel. Lighthouse is the most beautiful and amazing open-source automated tool for improving the quality of web-pages. It audits webpage for performance, accessibility, progressive web app and SEO and many more.

Note : I will cover lighthouse in another article.

4. Console Dev Tool panel —

As we covered in our previous article about console and its methods.

With help of Console we can use log variables, function calls, debug, error and warning method that might help us to understand the flow of our code and help in debugging the logs accordingly in various tools.

Let’s now understand how we can see console.log in our dev tool.

Step 1 — Open Dev tool

Step 2 — Navigate to Console Panel

Devtool — Navigate to Console Panel

Step 3 — Viewing Console Message — Default view

Devtool —Viewing Console Message — Default view

Step 4 — Logging Message to the Console window

Open any website and toggle on/off highlight —

You will notice of appearing and disappearing of console based on selection

Devtool — Logging Message to the Console window

b) Error Console Logs Appearance

— always appear in Red

Error Console Logs Apperance (Red in color)

c) Side panel Console Panel window

  • In the Side Console panel, We can GUI interface with all Methods
  • Any messages logged to the console by the web page will also appear here.

d) Clearing the Console

  • If the console gets too cluttered, We can clear it by clicking the “Clear console” button (usually a circle with a line through it)

e) Executing JavaScript in the Console

  • You can directly execute JavaScript code in the Console panel by typing it into the command line interface and pressing Enter.
Executing JavaScript in the Console like const a= 2

f). Filtering Messages

a) If there are too many messages in the console, you can filter them by clicking on the filter icon (usually a funnel-shaped icon)

b) Selecting the types of messages you want to see (e.g., Errors, Warnings, Logs).

Filtering Messages — Console DevTool

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 27 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation with Kirti kaushal
Coding Interviews
Javascript Tips
Front End Development
Frontend
Programming
Recommended from ReadMedium