Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Math</h1> <h2>The Math.log() Method</h2> <p>Math.log() returns the natural logarithm (base E) of a number:</p> <p id="demo"></p> <script> let a = Math.log(-0); let b = Math.log(0); let c = Math.log(-1); let d = Math.log(1); let e = Math.log(10); let f = Math.log(Infinity); let g = Math.log(-Infinity); document.getElementById("demo").innerHTML = a + "<br>" + b + "<br>" + c + "<br>" + d + "<br>" + e + "<br>" + f + "<br>" + f; </script> </body> </html>