compute pi using javascript code example
Example 1: how accurate is pi javascript
Math.PI;
// 3.14152653589793
// accurate to 15 digits (including ones place)
Example 2: getting the value of pi in javascript
<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>