JavaScript Math asinh() Method

The Math asinh() method is used to calculate the hyperbolic arc-sine of a number. The hyperbolic arc-sine is known by other names such as inverse hyperbolic sine.

Syntax

Math.asinh(x)

Parameters

x: It is a number whose hyperbolic arcsine value is to be determined.

Return Value

Returns the inverse hyperbolic sine (asinh) of the number you pass to it.

Visual RepresentationVisual Representation of JavaScript Math asinh() MethodExample 1: How to Use asinh() Method

var a = 3; //positive number
var b = -3; //negative number
var c = 4.3; //float number
var d = 0;

console.log(Math.asinh(a));
console.log(Math.asinh(b));
console.log(Math.asinh(c));
console.log(Math.asinh(d));

Output

1.8184464592320668
-1.8184464592320668
2.1650167641453284
0

Example 2: Passing InfinityVisual Representation of Passing Infinity

console.log(Math.asinh(Infinity));  //postive Infinity
console.log(Math.asinh(-Infinity)); //negative Infinity

Output

Infinity
-Infinity

Example 3: For non-numeric and empty inputVisual Representation For non-numeric and empty input

console.log(Math.asinh("JavaScriopt")); //non-numeric value
console.log(Math.asinh()); //empty value

Output

NaN
NaN

Browser compatibility

  1. Google Chrome 38
  2. Edge 12
  3. Firefox 25
  4. Opera 25
  5. Safari 8

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.