console:info() 静态方法

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

向 web 控制台输出一个通知信息。仅在 Firefox,web 控制台的日志中的项目旁边会显示一个小的‘I‘图标

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

语法

js
info(obj1)
info(obj1, /* …, */ objN)
info(msg)
info(msg, subst1, /* …, */ substN)

参数

obj1 ... objN

要输出的 JavaScript 对象列表。对象 obj1,obj2,...列出顺序和输出顺序一致。

msg

JavaScript 字符串。可包含零个或多个替换字符串。

subst1 ... substN

用于替换 msg 内的替换字符串的 JavaScript 对象。可以对输出的格式进行额外的控制。

查看更多细节可访问 console 文件内的Outputting text to the console

规范

Specification
Console
# info

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
info() static method

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
See implementation notes.

参见