The Math.log function in JavaScript is
used to return the natural logarithm
of a number.
Syntax
From the code above code,
we can see that the output
for any negative number is NaN
and
for 0 is -Infinity
.
This is the reason it is preferred
to use a positive number as a parameter
to the Math.log()
method.