Console info()
Example
Write a message to the console:
console.info("Hello world!");
Try it Yourself »
More examples below.
Description
The info()
method writes a message to the console.
Note
When testing console methods, be sure to have the console view visible.
Press F12 to open the console veiw.
Syntax
console.info(message)
Parameters
Parameter | Description |
message | Required. The message to write to the console. |
More Examples
Using an object as the message:
const myObj = {firstname:"John", lastname:"Doe"};
console.info(myObj);
Try it Yourself »
Using an array as the message:
const myArr = ["Orange", "Banana", "Mango", "Kiwi"];
console.info(myObj);
Try it Yourself »
Browser Support
console.info()
is supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | 8-11 | Yes | Yes | Yes | Yes |