JavaScript console.log() Method Last Updated : 09 Jan, 2025 Comments Improve Suggest changes Like Article Like Report 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") OutputHello Geeks We can even print an array or an object on the console using log() methodLogging a Object and Array JavaScript // Logging an Object const myObject = {Skill1:"HTML", Skill2:"CSS"}; console.log(myObject); // Logging an array const myArray = ["HTML", "CSS", "JavaScript"]; console.log(myArray); Output{ Skill1: 'HTML', Skill2: 'CSS' } [ 'HTML', 'CSS', 'JavaScript' ] Supported Browsers: Google ChromeEdge FirefoxOperaSafari Comment More infoAdvertise with us Next Article JavaScript console.log() Method S Sakshi98 Follow Improve Article Tags : Misc JavaScript Web Technologies JavaScript-Methods Practice Tags : Misc Similar Reads JavaScript Math log() Method The JavaScript Math log( ) Method is used to return the natural logarithm (base e) of a number. The JavaScript Math.log() method is equivalent to ln(x) in mathematics. If the value of x is negative, then the math.log() method return NaN. The log() is a static method of Math, therefore, it is always 3 min read JavaScript Math log2() Method The Javascript Math.log2() is an inbuilt method in JavaScript that gives the value of base 2 logarithms of any number. Syntax: Math.log2(p)Parameters: This method accepts a single parameter p which is any number whose base 2 logarithms is to be calculated.Returns: It returns the value of base 2 loga 3 min read JavaScript Math log10() Method The Javascript Math.log10() is an inbuilt method in JavaScript that gives the value of base 10 logarithms of any number.Syntax:Math.log10(p)Parameters: This method accepts a single parameter p which is any number whose base 10 logarithms is to be calculated.Return Value: It returns the value of base 3 min read JavaScript Math log1p() Method Javascript Math.log1p() is an inbuilt function in JavaScript that gives the value of the natural logarithm of 1 + p number. The natural logarithm is of base e, where e is an irrational and transcendental number approximately equal to 2.718. Syntax:Math.log1p(1 + p)Below example illustrate the JavaSc 4 min read Console in JavaScript The console object provides access to the browser's debugging console (or terminal in Node.js). It is used to log information, debug code, and interact with the runtime environment during development.Commonly Used console MethodsHere are the most frequently used methods of the console object:1. cons 3 min read HTML DOM console log() Method The console.log() method in HTML is used for writing a message in the console. It indicates an important message during the testing of any program. The message is sent as a parameter to the console.log() method. Syntaxconsole.log( message )ParametersParameterDescriptionmessageIt is mandatory and use 2 min read HTML DOM console count() Method The console.count() method in HTML is used to write the number of times the console.count() method is called. The console.count() method can be added to a label that will be included in the console view. The label is an optional parameter sent to the console.count() method. Syntax:console.count( lab 2 min read JavaScript Math LOG2E Property The Javascript Math.LOG2E is a property in JavaScript that is simply used to find the value of base 2 logarithms of e, where e is an irrational and transcendental number approximately equal to 1.442.Syntax:Math.LOG2E;Return Values: It simply returns the value of the base 2 logarithms of e.Example: H 3 min read HTML DOM console.info() Method The console.info() method in HTML is used for writing a message in the console. It indicates an important message about any element or object. The message is sent as a parameter to the console.info() method.Syntax:  console.info( message )Parameters: This method accepts a single parameter message wh 2 min read Node.js console.count() Method The console.count() method is an inbuilt application programming interface of the console module which is used to count label passed to it as a parameter, by maintaining an internal counter for that specific label. Syntax: console.count(label) Parameters: This method has one parameter as mentioned a 2 min read Like