JavaScript tanh() Method
Example
Return the hyperbolic tangent of a number:
let x = Math.tanh(1);
Output result:
0.7615941559557649
Try it »
Definition and Usage
The tanh() function returns the hyperbolic tangent of a number, using the formula below:

Browser support
| Chrome | Edge | Firefox | Safari | Opera |
| Yes | Yes | Yes | Yes | Yes |
Syntax
Math.tanh(
x
)
Parameter value
| Parameters | Description |
|---|---|
| x | Required. The number to be calculated. |
Return Value
| Type | Description |
|---|---|
| Number | The hyperbolic tangent of the given number. |
Technical Details
| JavaScript version: | 1.0 |
|---|
More examples
Math.tanh(0); // 0
Math.tanh(Infinity); // 1
Math.tanh(1); // 0.7615941559557649
JavaScript Math object