Javascript continue Statement Labeled continue Statement

Introduction

Labeled continue statement in a nested for statement.


nextRow: // target label of continue statement
   for ( let row = 1; row <= 5; ++row )
   {//from  w w w .  ja v a 2 s.  c  om
      console.log( "\n" );

      for ( let column = 1; column <= 10; ++column )
      {
         if ( column > row )
            continue nextRow; // next iteration of labeled loop   

         console.log( "*" );
      } //end for
   } //end for



PreviousNext

Related