JS Built-ins
← Math168 / 215
Mathpowintermediate

Math.pow() β€” Square Root via Exponent

πŸ“– Usage Example
// Raise base to an exponent
Math.pow(2, 8)    // β†’ 256
Math.pow(4, 0.5)  // β†’ 2

Use Math.pow(base, exp) to compute exponential values; in modern JS the ** operator is preferred.

Math.pow()

Returns the base raised to the exponent power.

Challenge: Use Math.pow(4, 0.5) to compute the square root of 4.

πŸ’‘ Hints (1)
  • β€’ x^0.5 = sqrt(x); Math.pow(4, 0.5) = Math.sqrt(4) = 2