JavaScript tutorial:
sqrt method

 

Applies to: Math Object

The sqrt method is use to get the square root of a number.

Syntax

Math.sqrt(number)

The number argument is a numeric expression.

Return value

Returns the square root of a number.

Example

If number is negative, the return value is zero.

See also: Math Object Methods, SQRT1_2 Property, SQRT2 Property