JavaScript asinh

The JavaScript asinh function is a Math function used to calculate the trigonometric hyperbolic arc sine for the specified expression or number. The asinh() method is also called the inverse of the hyperbolic sine value.

The syntax of the asinh function is:

Math.asinh(number);

Return Value: It accepts a number and returns the inverse hyperbolic sine value of it.

JavaScript asinh Function Example

In this JavaScript example, we find the Hyperbolic Arc Sine values of different data types and display the output.

<!DOCTYPE html>
<html>
<head>
    <title> JavaScriptASINHFunction </title>
</head>
<body>
  <h1> JavaScriptASINHFunction </h1>
  <p id = "Pos"></p>
  <p id = "Neg"></p>
  <p id = "Dec"></p>
  <p id = "Neg_Dec"></p>
  <p id = "Str"></p>
  <p id = "Exp"></p>
  <p id = "Null"></p>
  <p id = "Multi"></p>
  <script>
    document.getElementById("Pos").innerHTML = Math.asinh(10);
    document.getElementById("Neg").innerHTML = Math.asinh(-20);
    document.getElementById("Dec").innerHTML = Math.asinh(0.45);
    document.getElementById("Neg_Dec").innerHTML = Math.asinh(-0.75);
    document.getElementById("Str").innerHTML = Math.asinh("JavaScript");
    document.getElementById("Null").innerHTML = Math.asinh(null);
    document.getElementById("Multi").innerHTML = Math.asinh(0.25 + 0.55 - 0.77);
  </script>
</body>
</html>
JavaScript asinh Function Example

String value in the asinh Math function returns NaN (Not a Number) as an output. Please refer to the sin(), asin, and sinh() methods to find the Sine and hyperbolic arc sine values.

document.getElementById("Str").innerHTML = Math.asinh("JavaScript");

Using this method on Null returns Zero as output

document.getElementById("Null").innerHTML = Math.asinh(null);

Example 2: In this example, we use the asinh() function to find the inverse hyperbolic sine value of positive and negative 0.

console.log(Math.asinh(0));
console.log(Math.asinh(-0));
0 
-0

Example 3: If we use the asinh() function on positive and negative infinity, it returns the same result. When we apply the asinh() on NaN values, it returns NaN as output.

let a = Infinity;
let b = -Infinity;
let c = NaN;
console.log(Math.asinh(a));
console.log(Math.asinh(b));
console.log(Math.asinh(c));
Infinity 
-Infinity 
NaN