DEV Community

Cover image for Console Every Where
Alestor Aldous
Alestor Aldous

Posted on

Console Every Where

Alt Text

Did you know that there are more console than console.log

Stick to the end because we are going to find out

So What Is Happening ????

So there are many options for console such as

console.log("This is the outer level");

console.group("First group");

console.log("In the first group");

console.group("Second group");

console.log("In the second group");

console.warn("Still in the second group")
;
console.groupEnd();

console.log("Back to the first group");

console.groupEnd();

console.debug("Back to the outer level");

So Let Explain

console.assert()

Log a message and stack trace to console if the first argument is false.

console.clear()

To Clear the console.

console.count()

Log the number of times this line has been called with the given label.

console.countReset()

Resets the value of the counter with the given label.

console.debug()

Outputs a message to the console with the log level debug.

console.dir()

Displays an interactive listing of the properties of a specified JavaScript object. This listing lets you use disclosure triangles to examine the contents of child objects.

console.dirxml()

Displays an XML/HTML Element representation of the specified object if possible or the JavaScript Object view if it is not possible.

console.error()

Outputs an error message. You may use string substitution and additional arguments with this method.

console.group()

Creates a new inline group, indenting all following output by another level. To move back out a level, call groupEnd().

console.groupCollapsed()

Creates a new inline group, indenting all following output by another level. However, unlike group() this starts with the inline group collapsed requiring the use of a disclosure button to expand it. To move back out a level, call

groupEnd().
console.groupEnd()

Exits the current inline group.

console.info()

Informative logging of information. You may use string substitution and additional arguments with this method.

console.log()

For general output of logging information. You may use string substitution and additional arguments with this method.

console.profile() 

Starts the browser's built-in profiler (for example, the Firefox performance tool). You can specify an optional name for the profile.

console.profileEnd() 

Stops the profiler. You can see the resulting profile in the browser's performance tool (for example, the Firefox performance tool).

console.table()

Displays tabular data as a table.

console.time()

Starts a timer with a name specified as an input parameter. Up to 10,000 simultaneous timers can run on a given page.

console.timeEnd()

Stops the specified timer and logs the elapsed time in seconds since it started.

console.timeLog()
Logs the value of the specified timer to the console.

console.timeStamp() 

Adds a marker to the browser's Timeline or Waterfall tool.

console.trace()

Outputs a stack trace.

console.warn()

Outputs a warning message. You may use string substitution and additional arguments with this method.

Whoh Wait Bro Should I learn Every Thing ???

Just don't freak out let me explain

Actually It depends on which kind of application that your working on.

Feel Free To View CodeStackrs Video On This Topic

Everything Is AWESOME

Keep Coding !!!

🙏 Share with your friends on Twitter

👇 Find more posts on the following topics

Latest comments (0)