Console.group

From FirebugWiki

Jump to: navigation, search

Writes a message to the console and opens a nested block to indent all future messages sent to the console. Call console.groupEnd() to close the block.

Contents

[edit] Syntax

console.group([object, ...])

[edit] Parameters

[edit] object

Object to use as label for the group. This can be any kind of object, though will normally be a string. If no object is given, "(nothing to output)" will be shown as default text.

[edit] Examples

console.group("Group of log messages");
console.log("Log message");
console.info("Info message");
console.groupEnd();

This creates a group called "Group of log messages" containing a log and an info message.

[edit] See also

Personal tools