Sitemap

JavaScript Console Methods

Aug 23, 2021
Press enter or click to view image in full size
Photo by AltumCode on Unsplash

The Console object provides access to the browser’s debugging console. While working with JavaScript, all of us have used the console.log() method. There are more console methods and in this blog post we’re going to take a look at the most popular ones.

We will set up a simple HTML markup and import JavaScript index.js file.

Press enter or click to view image in full size

Console.log() — outputs a message to the console.

Console.info() — outputs an informational message to the console.

Press enter or click to view image in full size

OUTPUT:

Console.warn() — outputs a warning message to the console.

Press enter or click to view image in full size

OUTPUT:

Console.error() — outputs an error message to the console.

OUTPUT:

Console.assert() — writes an error message to the console if the assertion is false.

Press enter or click to view image in full size

OUTPUT:

Console.table() — displays tabular data as a table.

OUTPUT:

Press enter or click to view image in full size

console.clear() — clears the console.

OUTPUT:

--

--

No responses yet