The Math.atanh()
function returns the hyperbolic arctangent of a number.
For values greater than 1 or less than -1, NaN is returned.
Math.atanh(x) // x is a number.
let a = Math.atanh(-2); // NaN console.log(a);//from ww w .j a v a 2s.com a = Math.atanh(-1); // -Infinity console.log(a); a = Math.atanh(0); // 0 console.log(a); a = Math.atanh(0.5) // 0.5493061443340548 console.log(a); a = Math.atanh(1); // Infinity console.log(a); a = Math.atanh(2); // NaN console.log(a);