Javascript Reference - JavaScript PI Property








The PI property returns the math PI which is the ratio of a circle's area to the square of its radius, approximately 3.14

Browser Support

PI Yes Yes Yes Yes Yes

Syntax

Math.PI

Return Value

A number representing PI.





Example

The following code shows how to find out the value of PI.


console.log(Math.PI);

The code above generates the following result.