JavaScript Math.asin()
The Math.asin(x) method returns the arcsine(inverse sine) of a number in radians.
Syntax
Math.asin(x)
Here, asin() is a static method. Hence, we use it as Math.asin().
Parameters- x - (Required).A number for which we want to compute the arcsine.
- The number must be in the range of -1 to 1.
- The arcsine value of the given angle.
- NaN - If the parameter is not within the range of -1 and 1, or not numeric.
Example
console.log(Math.asin(-1)); //-1.5707963267948966 console.log(Math.asin(1)); //1.5707963267948966 console.log(Math.asin(0)); //0 console.log(Math.asin(5)); //NaN console.log(Math.asin('A')); //NaNTry it Yourself