JavaScript Math asinh()

The asinh() method computes the hyperbolic arcsine of the specified number and returns it.

Example


asinh() syntax

The syntax of the Math.asinh() method is:

Math.asinh(number)

Here, asinh() is a static method. Hence, we are accessing the method using the class name, Math.


asinh() Parameter

The asinh() method takes a single parameter:

  • number - whose hyperbolic arcsine is to be calculated

asinh() Return Value

The asinh() method returns:

  • hyperbolic arcsine of the given argument number
  • NaN (Not a Number) for a non-numeric argument

Example 1: JavaScript Math.asinh()

In the above example, the Math.asinh() computes the hyperbolic arcsine of

  • -5 (negative number) - results in -2.3124383412727525
  • 0 (zero) - results in 0
  • 32 (positive number) - results in 4.15912713462618

Example 2: Math.asinh() with Infinity


Example 3: Math.asinh() with Non-Numeric argument

In the above example, we have tried to calculate the hyperbolic arcsine value of the string "Harry". That's why we get NaN as the output.


Recommended readings: