JS Built-ins
← Math170 / 215
Mathpowintermediate

Math.pow() β€” Zero to Zero

πŸ“– 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: Verify that Math.pow(0, 0) returns 1 by convention.

πŸ’‘ Hints (1)
  • β€’ 0^0 = 1 by convention in JavaScript (and most programming languages)