totn JavaScript

JavaScript: Math sinh() function

This JavaScript tutorial explains how to use the math function called sinh() with syntax and examples.

Description

In JavaScript, sinh() is a function that is used to return the hyperbolic sine of a number. Because the sinh() function is a static function of the Math object, it must be invoked through the placeholder object called Math.

Syntax

In JavaScript, the syntax for the sinh() function is:

Math.sinh(number);

Parameters or Arguments

number
The number used to calculate the hyperbolic sine.

Returns

The sinh() function returns the hyperbolic sine of a number.

Note

  • Math is a placeholder object that contains mathematical functions and constants of which sinh() is one of these functions.

Example

Let's take a look at an example of how to use the sinh() function in JavaScript.

For example:

console.log(Math.sinh(0.8));
console.log(Math.sinh(1));
console.log(Math.sinh(-5));

In this example, we have invoked the sinh() function using the Math class.

We have written the output of the sinh() function to the web browser console log, for demonstration purposes, to show what the sinh() function returns.

The following will be output to the web browser console log:

0.888105982187623
1.1752011936438014
-74.20321057778875

In this example, the first output to the console log returned 0.888105982187623 which is the hyperbolic sine of 0.8.

The second output to the console log returned 1.1752011936438014 which is the hyperbolic sine of 1.

The third output to the console log returned -74.20321057778875 which is the hyperbolic sine of -5.