JavaScript console.log() Method Last Updated : 09 Jan, 2025 Suggest changes Share 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 Advertise with us Next Article JavaScript console.log() Method S Sakshi98 Follow 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 Article Tags : Misc JavaScript Web Technologies JavaScript-Methods Practice Tags : Misc Like