The JavaScript asin function is a math function that calculates the trigonometric Arc Sine for the specified expression. Otherwise, we can say, asin() method returns the inverse of the sine function. The syntax of the asin Function is:
Math.asin(number);
Return Value: It returns the inverse sine value between -π/2 and π/2. If the given parameter is not a number or outside the range -1 and 1, it will return NaN.
JavaScript asin Function Example
In this example, we will find the JavaScript Arc Sine values for 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 a Null value, and it 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>

TIP: Please refer to the sinh, and asinh() methods to find the JavaScript hyperbolic arc sine values.
Example 2: If we use the asin() function on positive and negative numbers, it returns 0 and -0.
console.log(Math.asin(0));
console.log(Math.asin(-0));
0
-0
Example 3: When we pass the asin() method on positive and negative infinity or not a number, it returns NaN as output.
let a = Infinity;
let b = -Infinity;
let c = NaN;
console.log(Math.asin(a));
console.log(Math.asin(b));
console.log(Math.asin(c));
NaN
NaN
NaN