Sine Function in JavaScript

Level 125 keystrokes

Math.sin() returns the sine of 1 radian and prints 0.8414709848078965.

JavaScript code

// Math.sin() expects the angle in radians, not degrees: 1 radian ≈ 57.3°
// sin(1) is about 0.8415; for degrees use Math.sin(deg * Math.PI / 180)
1console.log(Math.sin(1));

Output

0.8414709848078965
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this JavaScript code and how often they appear.

  • .× 2
  • (× 2
  • )× 2
  • ;× 1

More JavaScript examples at level 1

← JavaScript typing practice