JavaScript Math sinh() method - JavaScript Tutorial

JavaScript Math sinh() method

BLUF: This tutorial on JavaScript Math sinh() method provides an in-depth look at JavaScript's core features. It includes practical examples and code snippets to help you master modern JS development.
Key Discovery: JavaScript Math sinh() method

Understanding JavaScript Math sinh() method is crucial for building dynamic, interactive web applications. Explore the examples below to see it in action.

The sinh function in JavaScript computes the hyperbolic sine of a specified number.

Syntax

The sinh function is expressed through the syntax outlined below:

Example

Math.sinh(num)

Parameter

num - A number.

Return

The hyperbolic sine of a number.

JavaScript Math sinh method example

In this section, we will explore the sinh function by examining a variety of examples.

Example 1

Let's see a simple example of sinh method.

Example

<script>

document.writeln(Math.sinh(-1)+"<br>");

document.writeln(Math.sinh(0)+"<br>");

document.writeln(Math.sinh(0.5)+"<br>");

document.writeln(Math.sinh(2));

</script>

Output:

Output

-1.1752011936438014

0

0.5210953054937474

3.626860407847019

Example 2

In this section, you have the opportunity to evaluate the sinh function using your own custom test cases.

Example

<script>

function display()

{

  var x=document.getElementById("num").value;

document.getElementById("result").innerHTML=Math.sinh(x);

}

</script>

<form>

  Enter a number: <input type="text" id="num">

  <input type="button"  onclick="display()" value="submit">

  </form>

  <p><span id="result"></span></p>

Input Required

This code uses input(). Please provide values below:

Logic Practice
Install Logic Practice
Add to home screen for a faster app-like experience