<script>
var a = 0;
var b = 0;
var foo = ()=>
{
for(let i=0;i<5;i++)
{
a+=1;
if(i===3)
{
break;
}
}
a+=1;
}
var bar = ()=>
{
for(let i=0;i<5;i++)
{
b+=1;
if(i===3)
{
return;
}
}
b+=1;
}
foo();
bar();
console.log("a:"+a+" "+"b:"+b); //a:5 b:4
</script>
1、Break jumps out of the closest loop.
2、Return jumps out of the function.