Math log( ) Method
Last updated
Last updated
The Math.log() method used to return the natural logarithm (base e) of a number. The JavaScript Math.log() method is equivalent to ln(x) in mathematics. If the value of x is negative, then math.log() method return NaN.
ONLY POSITIVE NUMBERS
The log() is a static method of Math, therefore, it is always used as Math.log(), rather than as a method of a Math object created.
When
Then base e logarithm of x is