Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Math object's PI property</title> </head> <body> <script> // Printing PI value document.write(Math.PI + "<br>"); // Prints: 3.141592653589793 // Function to calculate circle area function calculateCircleArea(radius){ var area = (Math.PI) * radius * radius; return area; } document.write(calculateCircleArea(5) + "<br>"); // Prints: 78.53981633974483 document.write(calculateCircleArea(10) + "<br>"); // Prints: 314.1592653589793 </script> </body> </html>