Search This Blog

Monday, September 17, 2018

Example Methods of browser Console object

Console.assert()

Log a message and stack trace to console if first argument is false.
Console.count()
Log the number of times this line has been called with the given label.
Console.debug() 
An alias for log();
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.
Console.error()
Outputs an error message. 
Console._exception()
An alias for error();
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; 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 information.
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 build-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 its start.
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.