JS Built-ins
← Math154 / 215
Mathlog10intermediate

Math.log10() β€” log10(0) = -Infinity

πŸ“– Usage Example
// Logarithm base 10
Math.log10(100)    // β†’ 2
Math.log10(1000)   // β†’ 3

Use Math.log10() to compute the base-10 logarithm, useful for magnitude comparisons or decibel calculations.

Math.log10()

Returns the base-10 logarithm of a number.

Challenge: Observe that Math.log10(0) returns -Infinity.

πŸ’‘ Hints (1)
  • β€’ log10 approaches -∞ as x approaches 0 from the right