Arc Sine in JavaScript

Level 126 keystrokes

Math.asin(1) returns the angle whose sine is 1, π/2 radians, and prints 1.5707963267948966.

JavaScript code

// Math.asin() is the inverse of sine: it returns the angle in radians
// sin(π/2) = 1, so Math.asin(1) is π/2 ≈ 1.5708; inputs outside -1..1 give NaN
1console.log(Math.asin(1));

Output

1.5707963267948966
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