JavaScript Taking the Square Root of a Number

In JavaScript, the Math.sqrt() function is used to take the square root of a number.

If the number given as a parameter to the function, that is, the square root of the desired number, is negative, the result is returned as NaN.

Let's examine the examples below..

The results are like this..



You May Interest

What is Difference Between Call and Apply Methods in Javascript ?

What is Difference Between Javascript and ECMAScript ?

What are Different Error Types in Javascript ?

What is go Method of History Object in Javascript ?

What are the Variable Naming Conventions in JavaScript ?