typeof 怎么判断类型是否相同
是这样吗?
var x=0,y=0;
function arraysSimilar(arr1, arr2){
if(arr1.length!=arr2.length) return false;
else
{
for(x=0;x<arr1.length;x++)
{
for(y=0;y<arr2.length;y++)
{
if(Object.prototype.toString.apply(arr1[x])==Object.prototype.toString.apply(arr2[y])) break;
else if(>typeof arr1[x]== >typeof arr2[y]) break;
}
if(y==arr2.length) return false;
else return ture;
}
}
}