console.dir

非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!

在控制台中显示指定JavaScript对象的属性,并通过类似文件树样式的交互列表显示。

Note: 此特性在 Web Worker 中可用

console-dir.png

语法

console.dir(object);

参数

object
打印出该对象的所有属性和属性值.

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help! (en-US)

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) (Yes) 8.0 (8.0) 9 (Yes) (Yes)
Available in workers ? (Yes) 38.0 (38.0) ? ? ?
Feature Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? (Yes) 8.0 (8.0) ? ? ?
Available in workers ? (Yes) 38.0 (38.0) ? ? ?

相关链接