azita
0
Q:

pi in js

//How to get pi:
//Way 1:
Pi = 3.14159;
//Way 2:
Pi = Math.PI;
4
//pi declare pi= MATH.PI
var pi = MATH.PI;
//console
console.log(pi);
//screen
document.write(pi);
1
<html>  
   <head>
      <title>JavaScript Math PI Property</title>
   </head>
   
   <body>      
      <script type = "text/javascript">
         var property_value = Math.PI
         document.write("Property Value is : " + property_value); 
      </script>   
   </body>
</html>
1

New to Communities?

Join the community