Using Math SQRT1_2 property to coding in Javascript/JS

This JavaScript tutorial explains how to use the math property known as Math.SQRT1_2 with syntax and examples.


In JavaScript, Math.SQRT1_2 is a math property that is used to return the rectangular root of 1/2 which is the mathematical steady 1/√2. Because Math.SQRT1_2 is a property of the Math object, it ought to be invoked thru the placeholder object referred to as Math.


In JavaScript, the syntax for the Math.SQRT1_2 property is:


Parameters or Arguments

There are no parameters or arguments for the Math.SQRT1_2 property.


The Math.SQRT1_2 property returns the mathematical constant 1/√2 which has an approximate cost of 0.7071067811865476. This is the reciprocal of the rectangular root of two


The Math.SQRT1_2 property is a property of the Math object and not a math function. However, we have covered the Math.SQRT1_2 property inside our JS Math Functions section because you will most in all likelihood use this property in conjunction with the Math functions found in this section.


Let’s take a look at an instance of how to use the Math.SQRT1_2 property in JavaScript.

For example:


In this example, we have invoked the Math.SQRT1_2 property the use of the Math class.

We have written the output of the Math.SQRT1_2 property to the internet browser console log, for demonstration purposes, to exhibit what the Math.SQRT1_2 property returns.

The following will be output to the web browser console log:


In this example, the Math.SQRT1_2 property back a price of 0.7071067811865476 which is the value of the mathematical steady 1/√2.