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 RepresentationExample 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 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 input
console.log(Math.asinh("JavaScriopt")); //non-numeric value
console.log(Math.asinh()); //empty value
Output
NaN
NaN
Browser compatibility
- Google Chrome 38
- Edge 12
- Firefox 25
- Opera 25
- Safari 8
Ankit Lathiya is a Master of Computer Application by education and Android and Laravel Developer by profession and one of the authors of this blog. He is also expert in JavaScript and Python development.