Home >>JavaScript Math Reference >JavaScript PI Property

JavaScript PI Property

JavaScript PI Property

JavaScript PI property is used to return the ratio of a circle's area to the square of its radius. Its value is approximately 3.14.



Browser Support

Property Chrome Edge Firefox Safari Opera
PI Yes Yes Yes Yes Yes

Here is an example of JavaScript PI property:

<p>Click the button to see the Output.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
function myFunction() {
  document.getElementById("demo").innerHTML = Math.PI;

Click the button to see the Output.