[color=red]arguments 并不是数组,只是碰巧用数字做索引,以及一个length属性,
getDocumentsByTagName(xxxx)获取的也不是数组,只是元素集合而已!
[/color]
结果:
[img]http://dl.iteye.com/upload/attachment/0082/0315/a2cb748d-e562-3b1a-aa37-5777c316f2e6.jpg[/img]
getDocumentsByTagName(xxxx)获取的也不是数组,只是元素集合而已!
[/color]
<!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>
结果:
[img]http://dl.iteye.com/upload/attachment/0082/0315/a2cb748d-e562-3b1a-aa37-5777c316f2e6.jpg[/img]