循环是
while
循环的变种。该循环程序在初次运行时会首先执行一遍其中的代码,然后当指定的条件为
true
时,它会继续这个循环。所以可以这么说,do...while
循环为执行至少一遍其中的代码,即使条件为
false,因为其中的代码执行后才会进行条件验证。
分析:先执行的一遍
do{
result=patt1.exec("The
best
things
in
life
are
free")
document.write(result)
}
这时页面上就是eeeeee,接着while判断result不为空,又执行do,这时指针已经到了末尾,返回null,document.write(result)就打印了null
是的,当i===6时,continue进入下一次循环,i没办法加1,就死这了do
{
i=i+1
if(i===6)
}
先让i+1再判断就可以了