Math.asin method
The Math.asin method returns the
arcsine (or inverse sine) of a number. The
parameter must be between -1 and 1,
otherwise NaN will be returned.
Syntax
Math.asin(number);
Example
Let's output the arcsine of
the number 0.45.
console.log(Math.asin(0.45));
The code execution result:
0.4667653390472964
Example
Let's output the arcsine of
the number -1:
console.log(Math.asin(-1));
The code execution result:
-1.5707963267948966
Example
Let's output the arcsine of the
number 45. Since the parameter
is greater than 1, NaN
will be returned:
console.log(Math.asin(45));
The code execution result:
NaN