JS Built-ins
← Math166 / 215
Mathpowbeginner

Math.pow() β€” 2^10 = 1024

πŸ“– 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(2, 10) to compute 2 to the power of 10.

πŸ’‘ Hints (1)
  • β€’ 2^10 = 1024, commonly known as 1 kilobyte in computing