JavaScript Math.asinh()
Syntax & Examples
Math.asinh() static-method
The Math.asinh() method in JavaScript returns the hyperbolic arcsine of a number. The hyperbolic arcsine of x is the unique number y such that sinh(y) = x, where sinh is the hyperbolic sine function.
Syntax of Math.asinh()
The syntax of Math.asinh() static-method is:
Math.asinh(x)
This asinh() static-method of Math returns the hyperbolic arcsine of a number.
Parameters
Parameter | Optional/Required | Description |
---|---|---|
x | required | A number for which to return the hyperbolic arcsine. |
Return Type
Math.asinh() returns value of type Number
.
✐ Examples
1 Using Math.asinh() with a positive number
In JavaScript, we can use the Math.asinh()
method to get the hyperbolic arcsine of a positive number.
For example,
- We call the
Math.asinh()
method with a positive numberx
. - The hyperbolic arcsine value is returned and stored in the variable
result
. - We log
result
to the console usingconsole.log()
method.
JavaScript Program
const x = 1;
const result = Math.asinh(x);
console.log(result);
Output
0.881373587019543
2 Using Math.asinh() with zero
In JavaScript, we can use the Math.asinh()
method to get the hyperbolic arcsine of zero.
For example,
- We call the
Math.asinh()
method with zerox
. - The hyperbolic arcsine value is returned and stored in the variable
result
. - We log
result
to the console usingconsole.log()
method.
JavaScript Program
const x = 0;
const result = Math.asinh(x);
console.log(result);
Output
0
3 Using Math.asinh() with a negative number
In JavaScript, we can use the Math.asinh()
method to get the hyperbolic arcsine of a negative number.
For example,
- We call the
Math.asinh()
method with a negative numberx
. - The hyperbolic arcsine value is returned and stored in the variable
result
. - We log
result
to the console usingconsole.log()
method.
JavaScript Program
const x = -1;
const result = Math.asinh(x);
console.log(result);
Output
-0.881373587019543
Summary
In this JavaScript tutorial, we learned about asinh() static-method of Math: the syntax and few working examples with output and detailed explanation for each example.