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

 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

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 25-Jun-2020

63 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements