HTML DOM console.info() method

Definition and usage

The console.info() method writes messages to the console.

Tip:When testing console methods, make sure the console view is visible (press F12 to view the console).

Instance

Example 1

Write messages to the console:

console.info("Hello world!");

Try it yourself

Example 2

Use an object as a message:

var myObj = { firstname : "Bill", lastname : "Gates" };
console.info(myObj);

Try it yourself

Example 3

Use an array as a message:

var myArr = ["Orange", "Banana", "Mango", "Kiwi" ];
console.info(myObj);

Try it yourself

Syntax

console.info(message)

Parameter value

Parameter Type Description
message String or Object Required. Write messages or objects to the console.

Browser Support

The numbers in the table indicate the first browser version that fully supports this method.

Method Chrome IE Firefox Safari Opera
console.info() Support 8.0 4.0 Support Support