javascript的函数参数arguments 并不是数组
arguments 并不是数组,只是碰巧用数字做索引,以及一个length属性, getDocumentsByTagName(xxxx)获取的也不是数组,只是元素集合而已!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>arguments 并不是数组</title>
<script type="text/javascript">
function testArgumentsConstructor(parame1,param2,param3,param4){
var arr= [];
alert(arguments.constructor + " \r\n" + arr.constructor)
}
testArgumentsConstructor();
</script>
</head>
<body>
</body>
</html>
结果:
