Math SQRT1_2 Property - Javascript Math

Javascript examples for Math:SQRT1_2

Description

The SQRT1_2 property returns the square root of 1/2, approximately 0.707.

Return Value:

A Number, representing the square root of 1/2

The following code shows how to return the square root of 1/2:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {//from www.ja  v  a2  s.  c o m
    document.getElementById("demo").innerHTML = Math.SQRT1_2;
}
</script>

</body>
</html>

Related Tutorials