Home >>JavaScript Math Reference >JavaScript LOG2E Property
JavaScript LOG2E property is used to return the base-2 logarithm of E. Its value is approximately 1.442.
Syntax:
Math.LOG2E
Property | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
LOG2E | Yes | Yes | Yes | Yes | Yes |
Here is an example of JavaScript LOG2 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.LOG2E; } </script> </body> </html>
Click the button to see the Output.