Returns the square root of a number.
Math
sqrt(x)
x
If the value of number (x) is outside the required range,sqrt returns 0.
sqrt is a static method of Math. As a result, you always use it as Math.sqrt(), rather than as a method of a Math object you create.
The following function returns the square root of the variable x:
If you pass getRoot the value 9, it returns 3; if you pass it the value 2, it returns 1.414213562373095.