JavaScript console.debug() method is “used to output a message to the web console at the ‘debug’ log level”. The message will only be displayed in the console if the console’s current log level is set to “debug” or a higher level of verbosity.
Syntax
console.debug(obj, msg)
Parameters
- obj: It is a list of JavaScript objects to output.
- msg: It is a JavaScript string containing zero or more substitution strings.
Return value
None.
Example 1: How to Use console.debug() Method
<script>
let obj = { name: "Maeve Willy" }
console.debug(obj, "You have reached here!")
</script>
Output
Example 2: JavaScript debugging
<script>
console.debug("Debugging information");
let x = 5;
let y = 10;
console.debug('The values of x and y are: ', x, y);
function calculateSum(a, b) {
console.debug('calculateSum is called with arguments: ', a, b);
return a + b;
}
let sum = calculateSum(x, y);
console.debug('The sum is: ', sum);
</script>
Output
By default, console.debug() outputs might not show up in your browser’s console. You must ensure the console’s log level includes “debug” messages. The method to do this varies by browser and by console.
Browser compatibility
The console.debug() Method is supported by all browsers.
That’s it.

Krunal Lathiya is a seasoned Computer Science expert with over eight years in the tech industry. He boasts deep knowledge in Data Science and Machine Learning. Versed in Python, JavaScript, PHP, R, and Golang. Skilled in frameworks like Angular and React and platforms such as Node.js. His expertise spans both front-end and back-end development. His proficiency in the Python language stands as a testament to his versatility and commitment to the craft.