摘要:
var arr = ["apple","orange","apple","orange","pear","orange"];function getWordCnt(){ var obj = {}; for(var i= 0, l = arr.length; i< l; i++){ var item 阅读全文
摘要:
js 判断字符的长度: function len(s){ var l =0; var a = s.split(""); for(var i=0;i<a.length;i++){ if(a[i].charCodeAt(0) < 299){ l++; }else{ l+=2; } } return l; 阅读全文