Below is the example of the Math SQRT2 Property.
// Here value of Math.SQRT2 is printed.
√ 2 = 1.4142
Return Values: It simply returns the value of square root of 2, whose value is approximate 1.4142.
Input : Math.SQRT2 Output : 1.4142135623730951
More codes for the above property are as follows:
Program 1: Value of square root of 2 can be printed as in the form of function as shown below.
Program 2: Here we consider Math.SQRT2 as a function but in actual it is a property that is why error as output is being shown.
Error: Math.SQRT2 is not a function
Program 3: It’s application is to find the value of the square root of 2 which is done with the help of this property. In mathematics, it needed a lot.
- Google Chrome 1 and above
- Internet Explorer 3 and above
- Firefox 1 and above
- Opera 3 and above
- Safari 1 and above