Home >>JavaScript Math Reference >JavaScript atanh() Method

JavaScript atanh() Method

JavaScript atanh() Method

JavaScript atanh() method is used to return the hyperbolic arctangent value of a given input number. If the parameter x is greater than 1 or less than -1 then the method will return NaN and if it is 1 then the method will return Infinity.

Syntax:
Math.atanh(x)

Parameter Values

Parameter Description
x This is a required parameter. It defines the given input number.

Browser Support

Method Chrome Edge Firefox Safari Opera
atanh() 38 12 25 8 25
Here is an example of JavaScript atanh() method
<html>
<body>
<p>Click the button to see the Output.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("demo").innerHTML = Math.atanh(.75);
}
</script>
</body>
</html>
Output:

Click the button to see the Output.

Example 2:
<html>
<body>
<p>Click the button to see the Output.</p>
<button onclick="myFunction1()">Try it</button>
<p id="demo1"></p>
<script>
function myFunction1() {
  document.getElementById("demo1").innerHTML = Math.atanh(1);
}
</script>
</body>
</html>
Output:

Click the button to see the Output.