JavaScript Math.cosh() Method

Shubham Vora Jan 30, 2023
  1. Syntax
  2. Parameters
  3. Returns
  4. Example Code: Use Math.cosh() to Get Hyperbolic Cosine
JavaScript Math.cosh() Method

We can get the hyperbolic cosine value of the number using the Math.cosh() method. Here, we can calculate the hyperbolic cosine of the number using the expression (e^numberValue + e^(1/numberValue)/2.

Syntax

let number = 2;
Math.cosh(number);

Parameters

x It is a required parameter. The Math.cosh() calculates the hyperbolic cosine for the x value.

Returns

The Math.cosh() method returns hyperbolic cosine of x. Note that the hyperbolic cosine would be of the Number type.

Example Code: Use Math.cosh() to Get Hyperbolic Cosine

We have taken different numeric values in the example below, for which we will find the hyperbolic cosine values and observe the output.

let numberValue1 = 10;
let numberValue2 = 2.4;

console.log(Math.cosh(numberValue1));
console.log(Math.cosh(numberValue2));

Output:

11013.232920103324
5.556947166965507

To get the hyperbolic cosine value, computer programmers can use the Math.cosh() method with all modern browsers.

Author: Shubham Vora
Shubham Vora avatar Shubham Vora avatar

Shubham is a software developer interested in learning and writing about various technologies. He loves to help people by sharing vast knowledge about modern technologies via different platforms such as the DelftStack.com website.

LinkedIn GitHub

Related Article - JavaScript Math