Math sqrt( ) Method
The Math.sqrt() method in JavaScript is used to square root of the number passed as parameter to the function.
Parameters: This method accepts a single parameter as mentioned above and described below:
value which hold the number whose square root is to be calculated.
Returns: Square root of the number passed as parameter passed as parameter.
Input : Math.sqrt(4)
Output : 2
console.log(Math.sqrt(25)); // 25
console.log(Math.sqrt(120)); // 10.954451150103322
console.log(Math.round(Math.sqrt(120))); // 11
Last updated
Was this helpful?