JavaScript Math.LN10 Property
In JavaScript, we have a total of 8 mathematical constants that can be accessed as Math properties and "Math.LN10" is one of them.
The JavaScript Math.LN10 property is used to represent the natural logarithm of 10, that is approximately 2.3025. This property is equivalent to Math.log(10).
Syntax
Following is the syntax of JavaScript Math.LN10 property −
Math.LN10
Return value
This property returns the natural logarithm of 10.
Example 1
In the following example, we are retrieving the natural logarithm of 10 using the JavaScript Math.LN10 property −
<html> <body> <script> const result = Math.LN10; document.write(result); </script> </body> </html>
Output
After executing the above program, we get a value approximately 2.3025.
Example 2
The Math.LN10 property is equivalent to Math.log(10) −
<html> <body> <script> const result = Math.log(10); document.write(result); </script> </body> </html>
Output
If we execute the above program, the Math.log(10) will return the same result as Math.LN10.
Advertisements