console:group() 静态方法

console.group() 方法在 Web 控制台上创建一个新的分组。随后输出到控制台上的内容都会被添加一个缩进,表示该内容属于当前分组,直到调用 console.groupEnd() 之后,当前分组结束。

备注: 此特性在 Web Worker 中可用。

语法

js
group()
group(label)

参数

label

分组标签。

返回值

无(undefined)。

规范

Specification
Console Standard
# group

浏览器兼容性

BCD tables only load in the browser

参见