JavaScript USES the Math.PI method of the PI attribute

  • 2020-06-15 07:40:37
  • OfStack

This will return the ratio of 1 circle to the circumference of its diameter, about 3.14159.
grammar


Math.PI

Example:


<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>

This will produce the following results:


Property Value is : 3.141592653589793 


Related articles: