The following code shows how to Find Area of a Circle Using Anonymous Method.

<html>
  <head>
   <title>Anonymous Functions</title>
   <script>
     let findarea=function(){
        let r=prompt("Enter Circle Radius: ");
	r=Number(r);
        let area=Math.PI*r*r;
        document.write("Area = "+area);
     };
   </script>
  </head>
  <body>
   <center>
    <button onclick="findarea();" value="find">Find Circle Area</button>
   </center>
  </body>
</html>

Output

onclick Event Handler to call anonymous function
onclick Event Handler to call anonymous function
Taking Input from User in JavaScript
Taking Input from User in JavaScript
Calculating Area of Circle Using Anonymous Function
Calculating Area of Circle Using Anonymous Function