JavaScript asin

The JavaScript asin function is a Math function that calculates the trigonometry Arc Sine for the specified expression. Arc Sine is also called the inverse of a sine Function. The syntax of the JavaScript asin Function is

Math.asin(number);

If the number arg is not a number or outside the range -1 and 1, it will return NaN.

JavaScript asin Function Example

In this example, We are going to find the JavaScript Arc Sine values of different data types and display the output.

In the fifth line of the script, we used it on the string value that will return NaN (Not a Number). Next, we used. this Math function on the Null value returns Zero as output.

In the last line, We used the Positive integer 25 as an argument that is greater than one. It returns NaN.

<!DOCTYPE html>
<html>
<head>
    <title> JavaScriptASINFunction </title>
</head>
<body>
  <h1> JavaScriptASINFunction </h1>
  <p id = "Pos"></p>
  <p id = "Neg"></p>
  <p id = "Dec"></p>
  <p id = "Neg_Dec"></p>
  <p id = "Str"></p>
  <p id = "Exp"></p>
  <p id = "Null"></p>
  <p id = "Multi"></p>
  <p id = "Out"></p>
  <script>
    document.getElementById("Pos").innerHTML = Math.asin(1);
    document.getElementById("Neg").innerHTML = Math.asin(-1);
    document.getElementById("Dec").innerHTML = Math.asin(0.45);
    document.getElementById("Neg_Dec").innerHTML = Math.asin(-0.75);
    document.getElementById("Str").innerHTML = Math.asin("JavaScript");
    document.getElementById("Null").innerHTML = Math.asin(null);
    document.getElementById("Multi").innerHTML = Math.asin(0.25 + 0.55 - 0.77);
    document.getElementById("Out").innerHTML = Math.asin(25);
  </script>
</body>
</html>
JavaScript ASIN Example