请高手指点!
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb18030">
<title>Untitled Document</title>
</head>
<body>
<script type="text/javascript">
/*
* param1 Array
* param2 Array
* return true or false
*/
function arraysSimilar(arr1, arr2){
if(!(arr1 instanceof Array)||!(arr2 instanceof Array)){return "判定结果:不通过";}
if(arr1.length!=arr2.length){return "判定结果:不通过"; }
var count=0;
for(var i in arr1){
for(var j in arr2){
if(typeof arr1[i] ==typeof arr2[j]){count++;}
}
}
if(count==arr1.length){return "判定结果:通过";}else{return "判定结果:不通过"}
}
document.write(arraysSimilar([1,true,null],[null,false,100]));
</script>
<script src="testData.js"></script>
</body>
</html>
我的篇幅比课件答案简短很多,是否代表我的代码功能不如课件答案的功能完善呢?我有哪些方面的bug呢?谢谢。