Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Console object

Console object

The Console object provides access to the browser's debugging mode information in the console.

Method Description
assert() If the assertion is false, an error message is written to the console.
clear() Clears the information on the console.
count() Counts the number of count() calls, generally used for counting.
error() Outputs an error message to the console.
group() Creates an information group in the console. A complete information group starts with console.group() and ends with console.groupEnd().
groupCollapsed() Creates an information group in the console. Similar to console.group(), but it is collapsed by default.
groupEnd() Marks the end of the current information group.
info() Outputs a message to the console.
log() Outputs a message to the console.
table() Displays data in a table format.
time() A timer that starts timing, used together with timeEnd() to measure the exact time spent on an operation.
timeEnd() Ends the timing.
trace() Displays the call path of the currently executing code in the stack.
warn() Outputs a warning message with a yellow triangle at the beginning, indicating a warning.