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 Now
Next TopicJavaScript Math
|
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week