• Home
  • ES6
  • ADVANCED
    • Javascript Array Methods
    • Javascript String Methods
    • Javascript Regex
    • ES Next
  • JS BOM
  • JS DOM
  • WEB API
  • SNIPPETS
  • TYPESCRIPT
  • Golang
  • Dark Mode Light Mode
  • » Javascript Fundamental. » Meet the Console Tab of Devtools
    <h1 id="web-development-tools">Web Development Tools</h1> <p><strong>Summary</strong>: in this tutorial, you will learn how to open the Console tab of web development tools to view the messages.</p> <p>Web development tools allow you to test and debug the JavaScript code. Web development tools are often called devtools.</p> <p>Modern web browsers such as Google Chrome, Firefox, Edge, Safari, and Opera provide the devtools as built-in features.</p> <p>Generally, devtools allow you to work with a variety of web technologies such as HTML, CSS, DOM, and JavaScript.</p> <p>In this tutorial, you will learn how to open the Console tab of the devtools to view messages output by JavaScript.</p> <h2 id="google-chrome">Google Chrome</h2> <p>First, open the <a href="https://www.javascripttutorial.net/sample/devtools.html">devtools.html</a> file.</p> <p>The <code>devtools.html</code> file has the following JavaScript code:</p> <pre><code class="hljs language-html"><span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="language-javascript"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">&#x27;Hello, devtools!&#x27;</span>); <span class="hljs-comment">// the following code causes an error</span> <span class="hljs-keyword">let</span> greeting = msg; </span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span> Code language: HTML, XML (xml) </code></pre> <p>Second, press <code>F12</code> on Windows or <code>Cmd+Opt+J</code> if you are on Mac.</p> <p>The devtools will open the Console tab by default. It will look like this:</p> <p><img src="https://www.javascripttutorial.net/wp-content/uploads/2019/12/web-development-tool-console-tab.png" alt="web development tool - console tab"></p> <p>The first message is <code>&#39;Hello, DevTools!&#39;</code> which is the output of the following command:</p> <pre><code class="hljs language-sh">console.log(<span class="hljs-string">&#x27;Hello, DevTools!&#x27;</span>);Code language: JavaScript (javascript) </code></pre> <p>To output the value of the <a href="https://www.javascripttutorial.net/javascript-variables/">variable</a>, you use the following <code>console.log()</code> method. For example:</p> <pre><code class="hljs language-js"><span class="hljs-keyword">let</span> message = <span class="hljs-string">&#x27;Good Morning!&#x27;</span>; <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(message);<span class="hljs-title class_">Code</span> <span class="hljs-attr">language</span>: <span class="hljs-title class_">JavaScript</span> (javascript) </code></pre> <p>The second message that appears on the Console tab is an error.</p> <pre><code class="hljs language-sh">Uncaught ReferenceError: msg is not definedCode language: JavaScript (javascript) </code></pre> <p>This is because the variable <code>msg</code> has not been defined in the code but was referenced in the assignment.</p> <p>Now, you can see both normal messages issued by the <code>console.log()</code> and the error messages. It’s enough to start. We’ll dive into the devtools in the later tutorial.</p> <h2 id="firefox-and-edge">Firefox and Edge</h2> <p>Typically, you open the Console tab of the devtools in Firefox and Edge using <code>F12</code>. They have similar user interfaces.</p> <h2 id="safari">Safari</h2> <p>If you are using Safari browser on Mac, you need to enable the Developer Menu first:</p> <p><img src="https://www.javascripttutorial.net/wp-content/uploads/2019/12/Safari-Step-1.png" alt="img"></p> <p><img src="https://www.javascripttutorial.net/wp-content/uploads/2019/12/Safari-Step-2.png" alt="img"></p> <p>And then press <code>Cmd+Opt+C</code> to toggle the Console window:</p> <p><img src="https://www.javascripttutorial.net/wp-content/uploads/2019/12/Safari-Step-3.png" alt="img"></p> <p>In this tutorial, you have learned how to open the Console tab of the devtools for checking messages issued by JavaScript code.</p>

    GETTING STARTED

  • What is JavaScript
  • Install a JavaScript Code Editor
  • Meet the Console Tab of Devtools
  • JavaScript Hello World
  • JAVASCRIPT FUNDAMENTALS

  • Syntax
  • Variables
  • Data Types
  • Number
  • Numeric Separator
  • Octal and Binary Literals
  • Boolean
  • String
  • Object
  • Primitive vs. Reference Values
  • Array
  • JAVASCRIPT OPERATORS

  • Arithmetic Operators
  • Remainder Operator
  • Assignment Operators
  • Unary Operators
  • Comparison Operators
  • Logical Operators
  • Logical Assignment Operators
  • Nullish Coalescing Operator
  • Exponentiation Operator
  • CONTROL FLOW

  • if
  • if else
  • if else if
  • Ternary Operator (:?)
  • switch case
  • while
  • do while
  • for
  • break
  • continue
  • Comma Operator
  • JAVASCRIPT FUNCTIONS

  • Functions
  • Functions are First-Class Citizens
  • Anonymous Functions
  • Understanding Pass-By-Value in JavaScript
  • Recursive Functions
  • Default Parameters
  • JAVASCRIPT OBJECTS

  • Object Methods
  • Constructor Functions
  • Prototype
  • Constructor/Prototype Pattern
  • Prototypal Inheritance
  • this
  • globalThis
  • Object Properties
  • for…in Loop
  • Enumerable Properties
  • Own Properties
  • Object.values()
  • Object.entries()
  • Object.is()
  • Factory Functions
  • Object Destructuring
  • Optional Chaining Operator
  • Object Literal Syntax Extensions
  • CLASSES

  • Class
  • Getters & Setters
  • Class Expressions
  • Computed Properties
  • Inheritance
  • new.target
  • Static Methods
  • Static Properties
  • Private Fields
  • Private Methods
  • instanceof Operator
  • ADVANCED FUNCTIONS

  • Function Type
  • The call() Method
  • The apply() method
  • The bind() Method
  • Closures
  • Immediately Invoked Function Expression (IIFE)
  • Returning Multiple Values
  • Arrow Functions
  • Arrow Functions: Do & Don’t
  • Rest Parameters
  • Callback
  • PROMISES & ASYNC/AWAIT

  • Promises
  • Promise Chaining
  • Promise.all()
  • Promise.race()
  • Promise.any()
  • Promise.allSettled()
  • Promise.prototype.finally()
  • Promise Error Handling
  • async/await
  • JAVASCRIPT RUNTIME

  • Execution Context
  • Call Stack
  • Event Loop
  • Hoisting
  • Variable Scopes
  • About Me

    • Made by Rasel Mahmud
    • Portfolio

    Top References

    • javascripttutorial.net
    • W3school.com

    Top Tutorials

    • Primitive vs. Reference Values
    • What is JavaScript

    NOTE:

    This website only for Developing purpose not for business. and all content copied from other place like javascripttutorial.net and W3school.com