Math log( ) Method

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.

Natural Logarithm - ln(x)

Definition of natural logarithm

When

Then base e logarithm of x is

Last updated