Answers for "dart exit loop"

0

dart exit loop

void main() { 
 outerloop: // This is the label name 

   for (var i = 0; i < 5; i++) { 
   print("Innerloop: ${i}"); 
   innerloop: 

  for (var j = 0; j < 5; j++) { 
     if (j > 3 ) break ; 

     // Quit the innermost loop 
     if (i == 2) break innerloop; 

     // Do the same thing 
     if (i == 4) break outerloop; 

     // Quit the outer loop 
     print("Innerloop: ${j}"); 
   } 
 } 
}
Posted by: Guest on March-16-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language