Math.PI Property in JavaScript

HTMLJavascriptWeb DevelopmentFront End Technology

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

 Live Demo

<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
raja
Published on 29-Oct-2018 11:42:00
Advertisements