Type in the words(s) to search for:

    Mark results
      Userbooster Help

      break Statement

      Terminates the current loop.

      break;

      Remarks

      The statement can be used in switch statements and while, for and do...while loops.

      At the break, the script exits the current loop or statement and executes the next statement.

      Example

      function function_returns_8()
      {
      var x = 3;
          for( i = 0; i < 10; i++ )
          {
              if( i >= 5 )
                  break;
              x++;
          }
          return x;
      }