Syntax of a JavaScript SINH Function

The basic syntax of the SINH() Function in JavaScript Programming language is as shown below:

Math.sinh(number);

Number: It can be a number or a valid numerical expression for which you want to find hyperbolic Sine value.

If the number argument is positive or Negative number, SINH() function will return the hyperbolic Sine value.

If the number argument is not a number, JavaScript SINH() function will return NaN.

When the number argument is null value, SINH() function will return Zero.

HINT: We can achieve the same result using below formula. Please refer JavaScript EXP Function article to understand the Function.

(Math.exp(number) - Math.exp(- number)) / 2

JavaScript SINH Function Example

The JavaScript SINH Function allows you to find the trigonometry hyperbolic Sine for the numeric values. In this example, We are going to find the hyperbolic Sine values for different data types and display the output

Within the First two statements, We used the JavaScript SINH() Function directly on both the Positive integer and negative integer.

Next two statements, We used the SINH() Function on both the Positive and negative Decimal values. If you observe the above screenshot, SINH() function is working perfectly with Integers and Decimal values.

Next, We tried SINH() Function on String value. As we said before, this will return NaN (Not a Number) as output

document.getElementById("Str").innerHTML = Math.sinh("JavaScript");

Next, We tried JavaScript SINH() Function on Null value. As we said before, this will return Zero as output

document.getElementById("Null").innerHTML = Math.sinh(null);

In the below statement, We used the SINH() Function directly on multiple values.