How to debug code in ES6 ? Last Updated : 17 Feb, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we are going to learn how to debug a code in ES6. Debugging is the process of finding and resolving the problem or mistake in code due to which it doesn't work as expected. Debugging is an important part of programming that helps programmers to fix the bugs in the code. Checking an error in ES6:Before debugging an error we must know where the error occurred in the code, then you can go to resolve it. In es6 we can find the error in the console section of the web browser. Below is the way to access the console: Right Click on browser -> Select Inspect -> Go to Console tabExample: Basic example of error detection in the console in ES6. HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content= "width=device-width, initial-scale=1.0"> </head> <body> <h2 id="GFG">Welcome To GFG</h2> <h3>Error detection in Console in es6</h3> <script> function redirectME() { let age = 20 } console.log(age); </script> </body> </html> Output: Resolving errors in ES6 Using a Debugger: To Debug a code es6 provides a tool named debugger. A debugger allows the user to go at any line or function in the code to find and resolve the error. Below is the way to access Debugger: Right Click on browser -> Select Inspect -> Sources -> Go to your file and debug code line by line using Debugger Example: HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content= "width=device-width, initial-scale=1.0"> </head> <body> <h2 id="GFG">Welcome To GFG</h2> <h3>Error detection in Console in es6</h3> <script> function redirectME() { let age = 20; } console.log(age); </script> </body> </html> Output: Using JavaScript Validation parser or Validator for debugging: JavaScript Validation parser or Validators are the already written programs that check whether the valid syntax and rules of the language are used or not to write the code. Douglas Crockford's JavaScript Lint is a JavaScript validator that is mainly used by developers. Comment More infoAdvertise with us Next Article How to enable debugging in Express App ? A abhisheksainiaggarwal Follow Improve Article Tags : JavaScript Web Technologies Geeks Premier League Geeks-Premier-League-2022 ES6 JavaScript-Questions +1 More Similar Reads Node.js console.debug() Method The console.debug() method is an inbuilt application programming interface of the console module which is used to print messages to stdout in a newline. Similar to the console.log() method. Syntax: console.debug(data, args); Parameters: This method has two parameters as mentioned above and described 2 min read How to debug JavaScript File ? Debugging is essential because there are many errors that are not giving any kind of messages so to find out that we debug the code and find out the missing point. Example 1:  Using console.log() Method In this, we can find out the error by consoling the code in various places. Using a console is on 2 min read How to define a function in ES6 ? In this article, we will try to understand basic details which are associated with the function definition, like syntax declaration of a function or some examples associated with different types of functions declarations in ES6 (EcmaScript-6). Let us first understand what exactly the function is an 3 min read How to enable debugging in Express App ? In express, there is a module present called DEBUG that gives log information. It tells about middleware functions, application mode, their status, and also about the requests and responses made to the server. To use this module while running the express app, set the DEBUG environment variable to ex 3 min read How to Debug In Apple Safari Browser Debugging web applications in Safari is essential for developers and designers working on iOS or macOS platforms. Unlike other browsers, Safari offers unique tools through its Web Inspector that help troubleshoot layouts, inspect elements, and analyze performance directly from your Apple device. Whe 3 min read How do you debug Node applications? Debugging is a crucial aspect of software development, including NodeJS applications. NodeJS offers several built-in debugging options and tools to help developers identify and fix issues efficiently. Let's explore some common techniques and tools for debugging NodeJS applications. Using console.log 3 min read Like