How to use Math LOG2E Property in JavaScript

In this article, I will explain use of Math LOG2E Property in JavaScript.
  • 1383

JavaScript Math LOG2E Property

  • LOG2E property returns the base-2 logarithm of E which is approximately 1.442.

Syntax

Math.LOG2E

Example

The following example shows how to use Math LOG2E Property in javascript.

<!DOCTYPE html>

<html>

<body>

<h2>This is the Math LOG2E property example</h2>

<p id="demo">Click the button to display the base-2 logarithm of E.</p>

<button onclick="myFunction()">Click ON</button>

<script type="text/javascript">

    function myFunction() {

        document.getElementById("demo").innerHTML = Math.LOG2E;

    }

</script>

</body>

</html>

 

Output 1

 

LOG 2 E output.jpg


Output 2


LOG 2E Final output.jpg

Further Readings

You may also want to read these related articles here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2018 DotNetHeaven. All rights reserved.