Easy Tutorial
❮ Jsref Regexp Dot Jsref Constructor String ❯

JavaScript tanh() Method

JavaScript Math Object

Example

Return the hyperbolic tangent of a number:

let x = Math.tanh(1);

Output result:


Definition and Usage

The tanh() function returns the hyperbolic tangent of a number, defined as:


Browser Support

Chrome Edge Firefox Safari Opera
Yes Yes Yes Yes Yes

Syntax

Parameter Values

Parameter 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

❮ Jsref Regexp Dot Jsref Constructor String ❯