Latest web development tutorials

JavaScript PI property

Math Object Reference JavaScript Math Object

Examples

Back PI:

Math.PI;

Output:

3.141592653589793

try it"

Definition and Usage

PI attribute is π, circumference of a circle and its diameter ratio. This value is approximately 3.14.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the PI attribute.


grammar

Math.PI

technical details

return value: Back pi (approximately equal to 3.14159).
JavaScript version: 1.0


Math Object Reference JavaScript Math Object