今天看javascript权威指南的时候发现break的语法有两种(break; 和 break label;)。。。以前都没仔细看,就在前几页。
但是不明白label怎么写,于是上网查了一下,找到了一个例子
function foo ()
{
dance:
for(var k = 0; k for(var m = 0; m if(m == 2){
break dance;
}
}
}
}
这样就可以直接break掉整个循环嵌套了!!
(c,java的break都是这样的,读书不认真啊。。。)
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn