Home >>JavaScript Math Reference >JavaScript SQRT2 Property

JavaScript SQRT2 Property

JavaScript SQRT2 Property

JavaScript SQRT2 property is used to return the square root of value 2. Its result value is approximately 1.414.

Syntax:

Math.SQRT2

Browser Support

Property Chrome Edge Firefox Safari Opera
SQRT2 Yes Yes Yes Yes Yes

Here is an example of JavaScript SQRT2 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.SQRT2;
}
</script>
</body>
</html>
Output:

Click the button to see the Output.

 


No Sidebar ads