Home >>JavaScript Math Reference >JavaScript LN2 Property

JavaScript LN2 Property

JavaScript LN2 Property

JavaScript LN2 property is used to return the natural logarithm of 2. It’s value is approximately 0.693.

Syntax:

Math.LN2

Browser Support

Property Chrome Edge Firefox Safari Opera
LN2 Yes Yes Yes Yes Yes

Here is an example of JavaScript LN2 property:

<html>
<body>
<p>Click the button to see the Output.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("demo").innerHTML = Math.LN2;
}
</script>
</body>
</html>
Output:

Click the button to see the Output.

 


Popular Tutorials