摘要: 今天发现一个很有意思的正则代码,题目很简单 var reg =/123/g; var str = "123#abc"; console.log(reg.test(str)); //true console.log(reg.test(str)); //false console.log(reg.test(str)); //true console.log(reg.test(str)); //false 看似很简单,但是运行结果却让我很纳闷,What's happened?是因为test的返回值吗?test()之后返回boolean不会有影响的应该,那么问题出在哪呢?咱 阅读全文
posted @ 2013-04-03 11:27 forty2 阅读(166) 评论(0) 推荐(0) 编辑