JS Built-ins
MathLN2beginner

Math.LN2 β€” equals Math.log(2)

πŸ“– Usage Example
// Natural logarithm of 2
Math.LN2          // β†’ 0.6931471805...
Math.log(2) === Math.LN2   // β†’ true

Use Math.LN2 as a precomputed constant when converting between natural and base-2 logarithms.

Math.LN2

Math.LN2 is identical to calling Math.log(2), the natural log of 2.

Challenge: Verify that Math.log(2) === Math.LN2.

πŸ’‘ Hints (2)
  • β€’ Math.log computes the natural log.
  • β€’ Math.LN2 is a cached constant equal to Math.log(2).