Arc Cosine in JavaScript

Level 126 keystrokes

Math.acos(1) returns the angle whose cosine is 1, which is 0 radians, and prints 0.

JavaScript code

// Math.acos() is the inverse of cosine: it returns an angle from 0 to π radians
// cos(0) = 1, so Math.acos(1) is 0; Math.acos(-1) would be π
1console.log(Math.acos(1));

Output

0
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