![Math Log Method](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM2Yps-_KZoT3-hIAxqUQzyvAxG9Ahd7cmFN0upP3Y-PcgoNgkxOYL_EVxz1tgpPeebT1BvOojZrqdS_WsDaP0EpkxTTduF5PHWOEe7g_DzyrVzcJE5dOgpN0cZE10_DPPQQwv4ws1ooO4/s1600/Math-Log-Number.jpg)
Math.log() method is used to return the natural logarithm base E of a number. If the value of the number is negative, the return value is always NaN. If the value of the number is 0 it will return Infinity.
Syntax:
Math.log(x)
Example:
<script> var one = Math.log(5); document.writeln('Output of 5 is : ' + one + '</br></br>'); var two = Math.log(0); document.writeln('Output of 0 is : ' + two + '</br></br>'); var three = Math.log(-1); document.writeln('Output of -1 is : ' + three + '</br></br>'); var four = Math.log(88); document.writeln('Output of 88 is : ' + four + '</br></br>'); </script>
Output:
Output of 5 is : 1.6094379124341003 Output of 0 is : -Infinity Output of -1 is : NaN Output of 88 is : 4.477336814478207