JS Built-ins
← Math37 / 215
MathSQRT2beginner

Math.SQRT2 β€” equals Math.sqrt(2)

πŸ“– Usage Example
// Square root of 2
Math.SQRT2              // β†’ 1.4142135623...
Math.SQRT2 === Math.sqrt(2)   // β†’ true

Use Math.SQRT2 as a precomputed constant equal to √2, useful in geometry and diagonal calculations.

Math.SQRT2

Math.SQRT2 is identical to calling Math.sqrt(2).

Challenge: Verify that Math.sqrt(2) === Math.SQRT2.

πŸ’‘ Hints (2)
  • β€’ Math.SQRT2 is a pre-computed constant equal to Math.sqrt(2).
  • β€’ Using the constant avoids recomputing the square root each time.