JavaScript Math log() methodThe JavaScript math log() method returns the natural logarithm of the given number i.e. base e. If the number is negative, it returns NaN. SyntaxThe log() method is represented by the following syntax: Parameternum - A number. ReturnThe natural logarithm of a number. JavaScript Math log() method exampleHere, we will understand log() method through various examples. Example 1Let's see an example to print the natural logarithm of a number. Test it NowOutput: 0 1.6094379124341003 2.302585092994046 Example 2Let's see the result of log() method in different test cases. Test it NowOutput: NaN NaN -Infinity Example 3Here, you can test log() method with your own test cases. Test it NowNext TopicJavaScript Math |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India