大哥们 为啥我这啥输出结果都没
<!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(!Array.isArray(arr1)||!Array.isArray(arr2)||arr1.length!==arr2.length){
return false;
}
var a,b,c,d,e,f,g,h=0;
for(var i=0;i<arr1.length;i++){
var select=Object.prototype.toString.apply(arr1[i]);
switch(select){
case "[object String]":
a=a+1;
break;
case "[object Boolean]":
b=b+1;
break;
case "[object Number]":
c=c+1;
break;
case "[object Undefined]":
d=d+1;
break;
case "[object Null]":
e=e+1;
break;
case "[object Function]":
f=f+1;
break;
case "[object Array]":
g=g+1;
break;
case "[object Object]":
h=h+1;
break;
default:
break;
}
var secect1=Object.prototype.toString.apply(arr2[i]);
switch(select1){
case "[object String]":
a=a-1;
break;
case "[object Boolean]":
b=b-1;
break;
case "[object Number]":
c=c-1;
break;
case "[object Undefined]":
d=d-1;
break;
case "[object Null]":
e=e-1;
break;
case "[object Function]":
f=f-1;
break;
case "[object Array]":
g=g-1;
break;
case "[object Object]":
h=h-1;
break;
default:
break;
}
}
if(a==0&&b==0&&c==0&&d==0&&e==0&&f==0&&g==0&&h==0){
return true;
}
else{
return false;
}
}
</script>
<script src="testData.js"></script>
</body>
</html>