Home >>JavaScript Math Reference >JavaScript asin() Method

JavaScript asin() Method

JavaScript asin() Method

JavaScript asin() method is used to return the arcsine value of a given input number. Its value will be between -PI/2 and PI/2 radian. If the given input parameter x is outside the range of -1 to 1 then the browser will return NaN.

Syntax:
Math.asin(x)

Parameter Values

Parameter Description
x This is a required parameter. It defines the given input number.

Browser Support

Method Chrome Edge Firefox Safari Opera
asin() Yes Yes Yes Yes Yes
Here is an example of JavaScript asin() method:
<html>
<body>
<p>Click the button to see the Output.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("demo").innerHTML = Math.asin(0.144);
}
</script>
</body>
</html>
Output:

Click the button to see the Output.

Example 2:
<html>
<body>
<p>Click the button to see the Output.</p>
<button onclick="myFunction1()">Try it</button>
<p id="demo1"></p>
<script>
function myFunction1() {
  document.getElementById("demo1").innerHTML = Math.asin(-1);
}
</script>
</body>
</html>`
Output:

Click the button to see the Output.