JavaScript console info() Method

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.


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


  1. 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.
  2. msg: It is a JavaScript string containing zero or more substitution strings.
  3. 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 basic informational message.");


JavaScript console info()

Example 2: Displaying Variables

let name = "Alice";
let age = 30;"Name:", name);"Age:", age);


Displaying Variables using method

Example 3: Displaying Objects and Arrays

let person = {
  firstName: "John",
  lastName: "Doe",
  age: 25,
  isStudent: true

let fruits = ["apple", "banana", "cherry"];"Person Object:", person);"Fruits Array:", fruits);


Displaying Objects and Arrays using the

Browser Compatibility

Chrome IE Edge Firefox Safari Opera
Yes 8-11 Yes Yes Yes Yes

That’s it!

Related posts

JavaScript console debug()

JavaScript console clear()

JavaScript console log()

JavaScript console assert()

JavaScript console error()