<!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.length !== arr2.length ) return false;
var n = arr1.length;
var flag = 0;
var t1,t2;
for(var i = 0;i<n;i++){
for (var j=0;j<n;j++){
if (typeOf(arr1[i]) === typeOf(arr2[j])) {
flag++;
}
}
if (flag == n) return true;
}
return false;
}
function typeOf(arr){
var r;
if (arr === null) r='null';
else if (arr instanceof Array) r='array';
else if (arr === 'window') r = 'window';
else if (arr instanceof Date) r = 'date';
else r = typeof arr;
return r;
}
</script>
<script src="testData.js"></script>
</body>
</html>