# How to get the square root of a number in JavaScript?

JavascriptWeb DevelopmentFront End Technology

To get the square root, use the Math.sqrt() method. This method returns the square root of a number. If the value of a number is negative, sqrt returns NaN.

## Example

You can try to run the following code to get the square root of a number −

<html>
<title>JavaScript Math sqrt() Method</title>
</html>