Others



JavaScript Math.sin()


The Math.sin(x) method returns the sine of a number in radians.

Syntax
Math.sin(x)

Here, sin() is a static method. Hence, we use it as Math.sin().

Parameters
  • x - (Required).Angle for which we want to compute the sine.
Return Value
  • -1 to 1 - The sine value of the given angle.
  • NaN - non-numeric parameter.
Example
console.log(Math.sin(0));  //0
console.log(Math.sin(-3)); //-0.1411200080598672
console.log(Math.sin(1.5)); //0.9974949866040544
console.log(Math.sin('A')); //NaN
Try it Yourself

JavaScript Math Functions