![]() |
VOOZH | about |
In JavaScript, console.log() method is a built-in JavaScript function that outputs messages to the console, which is a special area in web browsers or runtime environments for developers to view information about their code.
It is primarily used for:
Syntax:
console.log("");The console.log() method is one of the most widely used debugging tools in JavaScript. It prints messages, variables, and expressions to the console, helping developers understand how their code is running.
Hello Geeks
We can even print an array or an object on the console using log() method
The console.log() method can log not only strings and numbers but also complex data types like objects and arrays. This makes it especially useful when debugging applications.
Output
{ name: "Alice", age: 25, city: "New York" }Output
["Apple", "Banana", "Cherry"]