The JavaScript math log() method is used to get the natural logarithm of a number.
Syntax:
Math.log(n)
Parameters
n: It represents the number whose logarithm have to be get.
Returns
Logarithm of a number
Example
<!DOCTYPE html> <html> <body> <script> document.writeln(Math.log(2)); </script> </body> </html> |
Output
0.6931471805599453 |
Please Share