2021年4月15日

统计字符串中出现的字母

摘要: 统计字符串中出现的字母 let str = "aabbabbbcchhddfgh"; let obj = {}; for(var v of str){ if(obj[v]&&obj[v].value == v){ obj[v].count = ++obj[v].count; }else{ obj[v 阅读全文

posted @ 2021-04-15 17:28 zhishiyv 阅读(77) 评论(0) 推荐(0) 编辑

JS数据校验

摘要: JS数据校验 module.exports = { error:'', isJSON : function (str){ if (typeof str == 'string') { try { ` · · if(typeof obj == 'object' && obj ){ return true 阅读全文

posted @ 2021-04-15 15:01 zhishiyv 阅读(88) 评论(0) 推荐(0) 编辑

导航