console.info()方法將信息性消息寫(xiě)入到控制臺(tái)。
該控制臺(tái)可用于測(cè)試或調(diào)試目的。
console.info(message)
console.info("這是一條信息...");測(cè)試看看?/?
所有瀏覽器完全支持console.info()方法:
Method | ![]() | ![]() | ![]() | ![]() | ![]() |
console.info() | 是 | 是 | 是 | 是 | 是 |
參數(shù) | 描述 |
---|---|
message | 要在控制臺(tái)中寫(xiě)入的字符串或?qū)ο?/td> |
本示例將一個(gè)對(duì)象寫(xiě)入控制臺(tái):
var myObj = { str: "Some text", id: 12 }; console.info(myObj);測(cè)試看看?/?
本示例將一個(gè)數(shù)組寫(xiě)入控制臺(tái):
var arr = ["Item1", "Item2", "Item3", "Item4"]; console.info(arr);測(cè)試看看?/?