JavaScript Console Methods

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.

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

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

OUTPUT:

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

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.

OUTPUT:

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

OUTPUT:

console.clear() — clears the console.

OUTPUT:

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet