JS Built-ins
← Math55 / 215
Mathacoshbeginner

Math.acosh() Always Returns a Number

πŸ“– Usage Example
// Inverse hyperbolic cosine (input must be β‰₯ 1)
Math.acosh(1)   // β†’ 0
Math.acosh(2)   // β†’ 1.3169...

Use Math.acosh() to compute the inverse hyperbolic cosine of a number β‰₯ 1.

Math.acosh(x)

Math.acosh() always returns a value of type number, even for invalid inputs.

Challenge: Verify the return type of Math.acosh() for various inputs.

πŸ’‘ Hints (2)
  • β€’ NaN is still of type number in JavaScript
  • β€’ All Math methods return a number primitive