PI

This property is used to return the value of PI, which is 3.141592653589793, exactly. As with all mathematical properties, it is used with the Math object.

syntax:

Math.PI

EXAMPLE

variableOne = Math.PI;

document.write("The returned value of PI is " + variableOne);

The example loads the value of pie into the variable variableOne. The contents of variable one are then written to the screen along with the text within the documnet.write statement. The output of the above example should look like the following:



The returned value of PI is 3.141592653589793