Console.group

From FirebugWiki
Revision as of 17:11, 21 November 2013 by Sebastianz (Talk | contribs) (Added categories)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Syntax[edit]

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

Parameters[edit]

object[edit]

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.

Examples[edit]

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.

See also[edit]