摘要: var pattern1 = /好/g;console.log(pattern1.test("你好"));字符串查找:var pattern1 = /\w/;console.log(pattern1.test("njkhjkjk"));空格查找:var pattern1 = /\s/;console... 阅读全文
posted @ 2015-03-28 11:07 唸随爱 阅读(1026) 评论(0) 推荐(0) 编辑
摘要: var c=[2,4,3,5,2,2,2], a = {}, i = 0; for(;i<c.length;i++){ a[c[i]] = 1 //利用对象名称不能重复的特性来去重 } c=[]; for(var g in a){ c.push(g-0); } conso... 阅读全文
posted @ 2015-03-28 10:52 唸随爱 阅读(237) 评论(0) 推荐(0) 编辑