<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>函数嵌套</title>
<!--计算两个圆面积和案例-->
</head>
<body>
<script type="text/javascript">
function total(r1,r2){
function area(r){
return 3.1415*r*r;
}
area=area(r1)+area(r2);
document.write("圆的面积和为"+area);
}
total(6,7);
</script>
</body>
</html>