The Math.log
method returns
the value of the natural logarithm
of a passed number.
Syntax
Math.log(number);
Example
In this example, the value of the
natural logarithm of 35
will be displayed:
console.log(Math.log(35));
The code execution result:
3.5553480614894135
Example
In this example, the value of the
natural logarithm of -10
will be displayed:
console.log(Math.log(-10));
The code execution result:
NaN