Tangent Function in JavaScript

Level 125 keystrokes

Math.tan() returns the tangent of 0 radians and prints 0.

JavaScript code

// Math.tan(x) returns the tangent, sin(x) / cos(x), with x in radians
// sin(0) is 0, so tan(0) is 0 and 0 is printed
1console.log(Math.tan(0));

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