<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript</title>
<script type="text/javascript">
function sum(a,b){
var result=0;
for(var i=0;i<arguments.length;i++)
{
if(typeof(arguments[i]=="number"))
{
result +=arguments[i];
}
}
return result;
}
alert(sum(1,2,3,4,5,6,7,8,9))
</script>
</head>
<body>
</body>
</html>
arguments隐形参数只能存在于function函数内!