Console Objects

Hello, Fellow Developers today we are going to talk about most used debugging tool by front-end developers  Console. The console provides access to the browser’s debugging console. The console object can be accessed from any global object  like :-  window.console or just console.

Lets see an example of how to use console in your code :-  console.log(“Sorry for the inconvenience we can’t open your link…”);

Now lets look at some method of  console :-

console.log()

It is used to display a message of logging information  in the console.

console.log("Hello World")

console.clear()

Clears the console.

console.clear()

console.count()

Counts number of  times this line is been executed.

console.count()

some more methods are : –

console.countReset()

Resets the counter label

console.error()

Outputs error message in the console.

console.info()

Outputs informational message to the console.

console.table()

Outpust Tabular data   as a Table.

console.time()

Starts the Timer.

console.timeEnd()

Stops the previously started Timer.

console.warn()

Outputs a Warning Message to Console.

Submit a Comment

Your email address will not be published.

Subscribe

Select Categories