Last Updated : 11 Jul, 2025
The console.log() method in JavaScript logs messages or data to the console.
The console.log() method is useful for debugging or testing purposes.
Syntax:console.log("");Parameters:
Any message either number, string, array object, etc.
Return value:It returns the value of the parameter given.
Using Console.log()Using the console.log() to print a string on the console.
JavaScript
console.log("Hello Geeks")
Logging a Object and Array JavaScriptWe can even print an array or an object on the console using log() method
// Logging an Object
const myObject = {Skill1:"HTML", Skill2:"CSS"};
console.log(myObject);
// Logging an array
const myArray = ["HTML", "CSS", "JavaScript"];
console.log(myArray);
{ Skill1: 'HTML', Skill2: 'CSS' } [ 'HTML', 'CSS', 'JavaScript' ]Supported Browsers:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4