# How to Use the Math.sqrt() Method in JavaScript

02/07/2022

Contents

In this article, you will learn how to use the Math.sqrt() method in JavaScript.

## The Math.sqrt() method

The Math.sqrt() method returns the square root of the number specified as an argument.

The syntax is below.

```
Math.sqrt(number)
```

For example, to calculate the hypotenuse of a triangle, it is as follows.

```
function calcHypotenuse(a, b) {
return (Math.sqrt((a * a) + (b * b)));
}
console.log(calcHypotenuse(3, 4));
// expected output: 5
```