Computer >> Computer tutorials >  >> Programming >> Javascript

Math.PI Property in JavaScript


The PI property of the Math object represents the value of pi (Ratio of the circumference and diameter of a circle.)

Syntax

Its Syntax is as follows

Math.PI

Example

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var result = Math.PI;
      document.write(result);
   </script>
</body>
</html>

Output

3.141592653589793