W3cubDocs

/Web APIs

console: groupCollapsed() method

The console.groupCollapsed() method creates a new inline group in the Web Console. Unlike console.group(), however, the new group is created collapsed. The user will need to use the disclosure button next to it to expand it, revealing the entries created in the group.

Call console.groupEnd() to back out to the parent group.

See Using groups in the console in the console documentation for details and examples.

Note: This feature is available in Web Workers

Syntax

js

groupCollapsed()
groupCollapsed(label)

Parameters

label

Label for the group. Optional.

Return value

None (undefined).

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
groupCollapsed 6 12 9 11 11 5.1 3 18 9 11 5 1.0

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/console/groupCollapsed