JavaScript console info() method is “used to output an informational message to the Web console.” In Firefox, a small “i” icon is next to these items in the Web console’s log.
Syntax
info(obj1, msg, subst1, /* …, */ substN)
Parameters
- obj1 … objN: It is a list of JavaScript objects to output. The string representations of each object are appended together in the order listed and output.
- msg: It is a JavaScript string containing zero or more substitution strings.
- subst1 … substN: JavaScript objects to replace substitution strings within msg. This gives you additional control over the format of the output.
Return value
It returns None (undefined).
Example 1: Basic usage
This is a simple demonstration of the console.info() method.
console.info("This is a basic informational message.");
Output
Example 2: Displaying Variables
let name = "Alice";
let age = 30;
console.info("Name:", name);
console.info("Age:", age);
Output
Example 3: Displaying Objects and Arrays using the console.info()
let person = {
firstName: "John",
lastName: "Doe",
age: 25,
isStudent: true
};
let fruits = ["apple", "banana", "cherry"];
console.info("Person Object:", person);
console.info("Fruits Array:", fruits);
Output
Browser Compatibility
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | 8-11 | Yes | Yes | Yes | Yes |
That’s it!
Related posts
JavaScript console debug() Method
JavaScript console clear() Method
JavaScript console log() Method
JavaScript console assert() Method
JavaScript console error() Method

Krunal Lathiya is a seasoned Computer Science expert with over eight years in the tech industry. He boasts deep knowledge in Data Science and Machine Learning. Versed in Python, JavaScript, PHP, R, and Golang. Skilled in frameworks like Angular and React and platforms such as Node.js. His expertise spans both front-end and back-end development. His proficiency in the Python language stands as a testament to his versatility and commitment to the craft.