JS Built-ins
← Math200 / 215
Mathsqrtintermediate

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

πŸ“– 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: Observe that Math.sqrt(Infinity) returns Infinity.

πŸ’‘ Hints (1)
  • β€’ sqrt(∞) = ∞ since no finite number squared equals infinity