有时返回的值是undefined,要用自定义的函数来获取是长度
数组的长度: var len=count(arrs)
function count(o){
var t = typeof o;
if(t == 'string'){
return o.length;
}else if(t == 'object'){
var n = 0;
for(var i in o){
n++;
}
return n;
}
return false;
}
this.count()