Answers for "does the break statement stop loops"

3

does break stop all loops

Using break in a nested loop

In a nested loop, a break statement only stops the loop it is placed in.
Therefore, if a break is placed in the inner loop, the outer loop still
continues. However, if the break is placed in the outer loop, all of the 
looping stops.
Posted by: Guest on November-24-2020
1

break for loop

Make the loop stop when i is 5.

for(i = 0; i < 10; i++){
	console.log(i)
   if (i == 5) {
   	break;
   }
}
Posted by: Guest on June-10-2021
0

how to break a loop

break
Posted by: Guest on October-08-2020

Code answers related to "does the break statement stop loops"

Python Answers by Framework

Browse Popular Code Answers by Language