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