【发布时间】:2015-08-20 16:46:59
【问题描述】:
这种情况是错误的?
在萤火虫中执行
altern = /raeeoCott/ig //
for(var h = 0; h<3; h++)
for(var i = 0; i<5; i++)
if(altern.test('raeeocott'))
console.log('ddd')
h=1 :: (8 true); ?????
// 5 * 3 = 15 != 8
为什么会这样?
【问题讨论】:
-
why is this happening?为什么会发生这种情况?你预计会发生什么? -
用你的代码我得到 8 次 console.log('ddd')。这有什么问题吗?
标签: javascript regex testing