1、break 语句可用于跳到循环外
var str=["wxx","is","a","little","boy"],word=""; for(var i=0;i<str.length;i++){ if(i==3){ break; } word=word+str[i]+" "; } console.log(word); //wxx is a
2、continue 跳出该步,继续下一个循环
for(var i=0;i<str.length;i++){ if(i==3){ continue; } word=word+str[i]+" "; } console.log(word); //wxx is a boy