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; }
时间: 2024-12-22 15:52:19
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; }