JS Built-ins
← Math198 / 215
Mathsqrtbeginner

Math.sqrt() β€” sqrt(0) = 0

πŸ“– Usage Example
// Square root of a non-negative number
Math.sqrt(16)   // β†’ 4
Math.sqrt(2)    // β†’ 1.4142...

Use Math.sqrt() to compute the square root of a non-negative number.

Math.sqrt()

Returns the square root of a number.

Challenge: Verify that Math.sqrt(0) returns 0.

πŸ’‘ Hints (1)
  • β€’ sqrt(0) = 0 because 0^2 = 0