Pi Constant in JavaScript

Level 121 keystrokes

Prints Math.PI, the ratio of a circle's circumference to its diameter: 3.141592653589793.

JavaScript code

// Math.PI is a read-only property, not a method, so there are no parentheses
// It holds π to double precision; e.g. a circle's area is Math.PI * r ** 2
1console.log(Math.PI);

Output

3.141592653589793
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
  • ;× 1
  • (× 1
  • )× 1

More JavaScript examples at level 1

← JavaScript typing practice